The carried test trees read the checkout where the test runner names it
Every env!("CARGO_MANIFEST_DIR") in validation's runtime_lane.rs and runtime_lane/ and in
metal2vulkan-runtime/src/tests (135 sites) named the directory the test binary was built in. A
nextest archive built on msi and run on another node with --workspace-remap read msi's path there:
teardown_threads panicked reading runtime_examples.ll, and public_cases read no case shard.
metal2vulkan-devtools gets one resolver, workspace_dir(): two levels above the manifest directory
the runner names as the test runs (cargo and nextest name the test's crate; a remapped archive
names it in the running machine's checkout), where that root holds the validation fixtures, else
above the dev-tools crate as built (the fallback fixtures_dir already had). validation_dir() and
fixtures_dir() sit on it; engine_dir() is unchanged. The sites move onto them:
- fixture reads (fixtures/public, engine/ and examples/) onto fixtures_dir() and engine_dir(),
with the two hand-rolled "runtime variable else built" copies (attachment_reads, encoder_holds);
- committed cases and observations (validation_dir()/corpus), and public_cases and
public_case_names now read the public source rows through source::public_sources_under on
fixtures_dir() instead of source::public_sources(), which bakes the path;
- the runtime tests' device profiles (validation_dir()/profiles) and degradation_sites' read of
the lane's sources;
- the conformance recordings, docs/API.md and the runtime's own src/ through workspace_dir().
The imports of std::path the moves left unused are removed.
Test-only. tests::the_carried_tests_read_the_checkout_where_the_runner_names_it (devtools, the
previous commit) fails before this commit and passes after. Verification: the msi job that builds
both commits, runs the remapped archive at each and lints the tip is reported with this sha.
With 4e06c87523 (the scan check), e9a0927685 (render_state.rs and line_width tests; the scan covers all of runtime/src),
74aa3e44cc and 086962f1fa (fixes; source.rs fixture reads through fixtures_dir). Test code only.
Compiled in m3-max-31605 (msi: clippy x3; scan passes; lavapipe suites 6235 passed, failures all pre-existing pin-97
items or the runtime-sources pin; remapped run with the build tree hidden 201/202, the last needing an all-targets
archive, 31641). Base 4e06c87523 (31508): scan lists 135 sites; remapped run fails 63/202.
This commit is contained in:
1 parent
3b27e62ddd
commit
39bff0de2a
115 files changed
+269
-397
No files matched your search
@@ -35,23 +35,49 @@ pub mod stitched;
|
||||
pub mod tools;
|
||||
pub mod xr_bicubic;
|
||||
|
||||
/// The validation crate's `fixtures/public` (`crates/metal2vulkan-validation/fixtures/public`,
|
||||
/// read-only): beside the manifest directory the test runner names as a test runs (`cargo test`
|
||||
/// and `cargo nextest` name the test's crate; a run of a nextest archive on another machine names
|
||||
/// it in that machine's checkout, `--workspace-remap`), else beside this crate as it was built.
|
||||
pub fn fixtures_dir() -> PathBuf {
|
||||
let beside = |manifest: &Path| {
|
||||
(manifest.parent()).map(|crates| crates.join("metal2vulkan-validation/fixtures/public"))
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
/// The workspace's root (read-only), as the test runner names it as a test runs: two levels above
|
||||
/// the manifest directory it names (`cargo test` and `cargo nextest` name the test's crate,
|
||||
/// `crates/<name>`; a run of a nextest archive on another machine names it in that machine's
|
||||
/// checkout, `--workspace-remap`) where that root holds the validation crate's fixtures, else above
|
||||
/// this crate as it was built. Tests read the checkout through it and the helpers on it
|
||||
/// ([`validation_dir`], [`fixtures_dir`], [`engine_dir`]), never through a path the build baked in
|
||||
/// (`env!("CARGO_MANIFEST_DIR")`), which names the build machine's checkout.
|
||||
pub fn workspace_dir() -> PathBuf {
|
||||
let root = |manifest: &Path| {
|
||||
manifest
|
||||
.parent()
|
||||
.and_then(Path::parent)
|
||||
.map(Path::to_path_buf)
|
||||
};
|
||||
let running = std::env::var_os("CARGO_MANIFEST_DIR")
|
||||
.and_then(|manifest| beside(Path::new(&manifest)))
|
||||
.filter(|fixtures| fixtures.is_dir());
|
||||
.and_then(|manifest| root(Path::new(&manifest)))
|
||||
.filter(|root| root.join(VALIDATION).join(FIXTURES).is_dir());
|
||||
running.unwrap_or_else(|| {
|
||||
beside(Path::new(env!("CARGO_MANIFEST_DIR")))
|
||||
root(Path::new(env!("CARGO_MANIFEST_DIR")))
|
||||
.expect("the dev-tools crate lies in the workspace's crates/")
|
||||
})
|
||||
}
|
||||
|
||||
/// The validation crate, relative to the workspace.
|
||||
const VALIDATION: &str = "crates/metal2vulkan-validation";
|
||||
|
||||
/// The public fixtures, relative to the validation crate.
|
||||
const FIXTURES: &str = "fixtures/public";
|
||||
|
||||
/// The validation crate's directory under [`workspace_dir`] (read-only): its committed cases and
|
||||
/// observations (`corpus/`), device profiles (`profiles/`) and sources.
|
||||
pub fn validation_dir() -> PathBuf {
|
||||
workspace_dir().join(VALIDATION)
|
||||
}
|
||||
|
||||
/// The validation crate's `fixtures/public` under [`validation_dir`] (read-only).
|
||||
pub fn fixtures_dir() -> PathBuf {
|
||||
validation_dir().join(FIXTURES)
|
||||
}
|
||||
|
||||
/// [`fixtures_dir`]'s `engine` (read-only; the engine's own fixtures).
|
||||
pub fn engine_dir() -> PathBuf {
|
||||
fixtures_dir().join("engine")
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//! Checks of the test trees that read the checkout through this crate's directory helpers.
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// The test trees, relative to the workspace, that run from nextest archives carried to other
|
||||
/// machines (`cargo nextest run --archive-file ... --workspace-remap <checkout>`): the runtime
|
||||
/// lanes and the runtime's lib tests (`src/tests/` and the test modules beside its sources).
|
||||
const CARRIED: [&str; 3] = [
|
||||
"crates/metal2vulkan-validation/src/runtime_lane",
|
||||
"crates/metal2vulkan-validation/src/runtime_lane.rs",
|
||||
"crates/metal2vulkan-runtime/src",
|
||||
];
|
||||
|
||||
/// The `.rs` files at or below `path`.
|
||||
fn sources(path: &Path, out: &mut Vec<PathBuf>) {
|
||||
if path.is_dir() {
|
||||
for entry in std::fs::read_dir(path).unwrap() {
|
||||
sources(&entry.unwrap().path(), out);
|
||||
}
|
||||
} else if path.extension().is_some_and(|extension| extension == "rs") {
|
||||
out.push(path.to_path_buf());
|
||||
}
|
||||
}
|
||||
|
||||
/// `env!("CARGO_MANIFEST_DIR")` is the directory the test binary was built in. A carried archive
|
||||
/// runs where that directory does not exist, so a test that reads a fixture, a committed case, a
|
||||
/// profile or a source file by it fails there ("No such file or directory"), or finds nothing to
|
||||
/// read. The carried trees read the checkout through [`crate::workspace_dir`] and the helpers on it,
|
||||
/// which take the directory the test runner names as the test runs; this lists every baked site
|
||||
/// left, as `file:line`.
|
||||
#[test]
|
||||
fn the_carried_tests_read_the_checkout_where_the_runner_names_it() {
|
||||
let root = crate::workspace_dir();
|
||||
let mut files = Vec::new();
|
||||
for tree in CARRIED {
|
||||
let path = root.join(tree);
|
||||
assert!(path.exists(), "{} is missing", path.display());
|
||||
sources(&path, &mut files);
|
||||
}
|
||||
files.sort();
|
||||
assert!(files.len() > 500, "{} sources read", files.len());
|
||||
let mut baked = Vec::new();
|
||||
for file in &files {
|
||||
let text = std::fs::read_to_string(file).unwrap();
|
||||
let relative = file.strip_prefix(&root).unwrap().display().to_string();
|
||||
for (at, line) in text.lines().enumerate() {
|
||||
if line.contains("env!(\"CARGO_MANIFEST_DIR\")") {
|
||||
baked.push(format!("{relative}:{}", at + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(
|
||||
baked.is_empty(),
|
||||
"{} reads of the build's directory in the carried tests (read through \
|
||||
metal2vulkan_devtools::{{workspace_dir, validation_dir, fixtures_dir, engine_dir}}):\n{}",
|
||||
baked.len(),
|
||||
baked.join("\n")
|
||||
);
|
||||
}
|
||||
@@ -46,10 +46,9 @@ impl Cell {
|
||||
/// A profile of the repository's, read as the runtime reads its device
|
||||
/// (`DeviceDescription::from_khronos_json`), so this runs from the workspace checkout.
|
||||
fn device(stem: &str) -> Device {
|
||||
let path = format!(
|
||||
"{}/../metal2vulkan-validation/profiles/{stem}.json",
|
||||
env!("CARGO_MANIFEST_DIR")
|
||||
);
|
||||
let path = metal2vulkan_devtools::validation_dir()
|
||||
.join("profiles")
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).unwrap();
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
Device::new(description, DevicePolicy::default()).unwrap()
|
||||
|
||||
@@ -2602,10 +2602,7 @@ mod tests {
|
||||
use metal2vulkan::vk::PrimitiveTopology as T;
|
||||
use DepthBiasEffect::{Factors, Offset, Saturated};
|
||||
// The repository's profile: this test runs only from the workspace checkout.
|
||||
let path = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/../metal2vulkan-validation/profiles/moltenvk-m3.json"
|
||||
);
|
||||
let path = metal2vulkan_devtools::validation_dir().join("profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description =
|
||||
metal2vulkan::device::DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
@@ -3247,10 +3244,7 @@ mod tests {
|
||||
fn biased_depths_move_the_draw_s_viewports() {
|
||||
use metal2vulkan::vk::PrimitiveTopology as T;
|
||||
// The repository's profile: this test runs only from the workspace checkout.
|
||||
let path = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/../metal2vulkan-validation/profiles/moltenvk-m3.json"
|
||||
);
|
||||
let path = metal2vulkan_devtools::validation_dir().join("profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description =
|
||||
metal2vulkan::device::DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
@@ -3332,10 +3326,8 @@ mod tests {
|
||||
fn a_returned_depth_keeps_its_range_under_the_written_clamp_s_compensation() {
|
||||
use metal2vulkan::vk::PrimitiveTopology as T;
|
||||
// The repository's profile: this test runs only from the workspace checkout.
|
||||
let path = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/../metal2vulkan-validation/profiles/intel-irisxe-rplp-anv.json"
|
||||
);
|
||||
let path =
|
||||
metal2vulkan_devtools::validation_dir().join("profiles/intel-irisxe-rplp-anv.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description =
|
||||
metal2vulkan::device::DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
|
||||
@@ -8,7 +8,6 @@ use crate::device::LayerSettingValue;
|
||||
use crate::error::{DriverSetting, Error};
|
||||
use metal2vulkan::device::DeviceDescription;
|
||||
use metal2vulkan::vk::DriverId;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// MoltenVK 1.4.1 on an Apple M3 Max, as `vulkaninfo` reported it (2026-10-07) with
|
||||
/// `MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS` on (the default) and off.
|
||||
@@ -115,7 +114,7 @@ fn the_instance_asks_moltenvk_for_argument_buffers() {
|
||||
/// as binding through argument buffers, and every other profile as not MoltenVK.
|
||||
#[test]
|
||||
fn the_committed_profiles_read_as_measured() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut moltenvk = 0;
|
||||
for path in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
let path = path.expect("directory entry").path();
|
||||
|
||||
@@ -64,8 +64,7 @@ fn device(cache: &Path, heard: &Heard) -> Device {
|
||||
|
||||
/// The element count of the set-1 sampler array of the kernel's pipeline on `device`'s profile.
|
||||
fn kernel_sampler_array(device: &Device) -> u32 {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/tail_argument_samplers.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tail_argument_samplers.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let function = metal2vulkan::library::Library::from_air(&bitcode)
|
||||
.unwrap()
|
||||
|
||||
@@ -277,8 +277,7 @@ fn signals_after_a_failing_encoder_are_dropped() {
|
||||
/// including at a release and on a GPU no lane measured.
|
||||
#[test]
|
||||
fn only_drivers_that_report_their_failures_by_messenger_relay_them() {
|
||||
let dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut moltenvk = 0;
|
||||
let mut other = 0;
|
||||
for entry in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
|
||||
@@ -260,9 +260,7 @@ fn writing_into_a_missing_directory_or_onto_a_directory_fails_as_metal_does() {
|
||||
|
||||
/// The function `name` of the committed AIR of fixture `stem`, its library made anew.
|
||||
fn function(stem: &str, name: &str) -> Function {
|
||||
let air = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine")
|
||||
.join(format!("{stem}.air"));
|
||||
let air = metal2vulkan_devtools::engine_dir().join(format!("{stem}.air"));
|
||||
Library::from_air(&fs::read(air).expect("the committed AIR"))
|
||||
.expect("library")
|
||||
.function(name)
|
||||
@@ -1073,11 +1071,8 @@ fn a_render_lookup_tells_one_adds_stages_from_two_adds() {
|
||||
fn a_metallib_loads_as_an_archive_holding_nothing() {
|
||||
use metal2vulkan_devtools::metallib::{metallib, wrap, MtlbFunction};
|
||||
let scratch = Scratch::new();
|
||||
let air = fs::read(
|
||||
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/ob3_texture_array.air"),
|
||||
)
|
||||
.expect("the committed AIR");
|
||||
let air = fs::read(metal2vulkan_devtools::engine_dir().join("ob3_texture_array.air"))
|
||||
.expect("the committed AIR");
|
||||
let bytes = metallib(&[MtlbFunction {
|
||||
name: "ob3_texture_array",
|
||||
type_code: 2,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
//! `capabilities`: Metal's device queries over every committed device profile
|
||||
//! (`validation/profiles/`, read-only), each checked against its source.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::capabilities::{
|
||||
amplification_count_supported, linear_alignment_rule, rate_map_layers_supported,
|
||||
sample_count_supported, working_set_buffer_bound, DeviceIdentity, RATE_MAP_LAYERS,
|
||||
@@ -23,7 +21,7 @@ use std::collections::BTreeMap;
|
||||
|
||||
/// Every committed profile's description: (file stem, description), sorted by stem.
|
||||
pub(super) fn committed_descriptions() -> Vec<(String, DeviceDescription)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut out: Vec<(String, DeviceDescription)> = std::fs::read_dir(&dir)
|
||||
.expect("validation/profiles is readable")
|
||||
.map(|e| e.expect("directory entry").path())
|
||||
@@ -52,8 +50,9 @@ pub(super) fn profile_value(stem: &str, key: &str) -> Option<serde_json::Value>
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join(format!("../metal2vulkan-validation/profiles/{stem}.json"));
|
||||
let path = metal2vulkan_devtools::validation_dir()
|
||||
.join("profiles")
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let json: serde_json::Value =
|
||||
serde_json::from_str(&text).unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
|
||||
@@ -39,7 +39,6 @@ use metal2vulkan::cache::PipelineArtifact;
|
||||
use metal2vulkan::library::{CompiledFunction, FunctionConstantValue, FunctionConstantValues};
|
||||
use metal2vulkan::metal::DataType;
|
||||
use metal2vulkan::pipeline::{ComputePipeline, ComputePipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -102,8 +101,7 @@ const PASSES: usize = 4;
|
||||
|
||||
/// `kernel`'s library on `device`.
|
||||
fn library(device: &Device, kernel: &Kernel) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
let ll = metal2vulkan_devtools::fixtures_dir()
|
||||
.join(kernel.directory)
|
||||
.join(format!("{}.ll", kernel.name));
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
|
||||
@@ -14,7 +14,6 @@ use super::blit_holds::{device, Scratch};
|
||||
use crate::PipelineOptions;
|
||||
use metal2vulkan::metal::FunctionType;
|
||||
use metal2vulkan_devtools::metallib::{core_image_metallib, metallib, wrap, MtlbFunction};
|
||||
use std::path::Path;
|
||||
|
||||
fn function<'a>(name: &'a str, type_code: u8, bitcode: &[u8]) -> MtlbFunction<'a> {
|
||||
MtlbFunction {
|
||||
@@ -61,8 +60,7 @@ fn a_core_image_library_answers_its_extern_functions() {
|
||||
assert!(library.new_extern_function_with_name("nope").is_err());
|
||||
|
||||
// An executable library: no extern names, and its kernel made by either call.
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/kernel_stage_in.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_stage_in.ll");
|
||||
let kernel = wrap(&metal2vulkan_devtools::llvm_assemble(&ll).unwrap());
|
||||
let executable = device
|
||||
.new_library_with_data(&metallib(&[function("stage_in_fetch_wide", 2, &kernel)]))
|
||||
|
||||
@@ -44,7 +44,6 @@ use super::blit_holds::{device, Scratch};
|
||||
use super::descriptor_key_once::descriptor;
|
||||
use crate::{PipelineOptions, WorkCounts};
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
|
||||
/// The two predictions' makings, and the whole count: render made, dispatch made, all made.
|
||||
fn made(counts: &WorkCounts) -> [u64; 3] {
|
||||
@@ -87,8 +86,7 @@ fn the_render_and_dispatch_predictions_are_counted_apart() {
|
||||
render[2], render[0]
|
||||
);
|
||||
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let function = device
|
||||
.new_library_with_compile_library(
|
||||
|
||||
@@ -38,7 +38,6 @@ use metal2vulkan::metal::{
|
||||
BlendFactor, PixelFormat, PrimitiveTopologyClass, PrimitiveType, TextureType, TextureUsage,
|
||||
};
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's side, in pixels.
|
||||
const SIDE: u64 = 8;
|
||||
@@ -52,8 +51,7 @@ fn state(
|
||||
samples: u32,
|
||||
class: PrimitiveTopologyClass,
|
||||
) -> Result<RenderPipelineState, Error> {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/rt6_render_state.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_render_state.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -53,7 +53,6 @@ use metal2vulkan::pipeline::{
|
||||
ComputePipelineDescriptor, StageInputAttributeDescriptor, StageInputDescriptor,
|
||||
StageInputLayoutDescriptor, StageSource,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The compute states the sweep makes.
|
||||
const SWEEP: u32 = 4;
|
||||
@@ -110,8 +109,7 @@ fn adds_up(made: &ShaderCacheStatistics) {
|
||||
fn a_creation_s_driver_time_and_directory_reads_reach_the_work_counts() {
|
||||
let scratch = Scratch::new("creation-split");
|
||||
let device = device(&scratch.0);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/kernel_stage_in.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_stage_in.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -1697,8 +1697,7 @@ fn a_compute_state_s_creation_waits_its_bound_for_its_predicted_making() {
|
||||
let scratch = Scratch::new("deferred-compute-creation-bound");
|
||||
let heard = Heard::default();
|
||||
let device = waiting_device(&scratch.0, waits, &heard);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let function = device
|
||||
.new_library_with_compile_library(
|
||||
|
||||
@@ -147,7 +147,7 @@ fn notices_are_warnings_named_by_code() {
|
||||
/// docs/API.md's catalogue lists every kind's code once, with its category, and no other code.
|
||||
#[test]
|
||||
fn the_catalogue_lists_every_kind_and_only_them() {
|
||||
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/API.md");
|
||||
let path = metal2vulkan_devtools::workspace_dir().join("docs/API.md");
|
||||
let guide = std::fs::read_to_string(path).unwrap();
|
||||
let mut listed = BTreeMap::new();
|
||||
for line in guide.lines() {
|
||||
|
||||
@@ -32,7 +32,7 @@ use std::collections::BTreeMap;
|
||||
/// docs/API.md's catalogue, each code's entry as one line of text: the words after the code and
|
||||
/// its category (`- \`<code>\` (<category>). `), with every continuation line.
|
||||
fn catalogue() -> BTreeMap<String, String> {
|
||||
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/API.md");
|
||||
let path = metal2vulkan_devtools::workspace_dir().join("docs/API.md");
|
||||
let guide = std::fs::read_to_string(path).unwrap();
|
||||
let mut entries = BTreeMap::new();
|
||||
let mut open: Option<(String, String)> = None;
|
||||
@@ -210,7 +210,8 @@ fn an_entry_that_only_resembles_the_cost_does_not_state_it() {
|
||||
/// Each kind's declaration in `degradation.rs`, keyed by its code: the rustdoc of its line in
|
||||
/// `degradations!`, every line of it as one line of text.
|
||||
fn declarations() -> BTreeMap<String, String> {
|
||||
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/src/degradation.rs");
|
||||
let path = metal2vulkan_devtools::workspace_dir()
|
||||
.join("crates/metal2vulkan-runtime/src/degradation.rs");
|
||||
let source = std::fs::read_to_string(path).unwrap();
|
||||
let (_, invocation) = source
|
||||
.split_once("\ndegradations! {")
|
||||
|
||||
@@ -25,11 +25,9 @@ use crate::Degradation;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// The lane's module tree: `runtime_lane.rs` and every `.rs` file below `runtime_lane/`.
|
||||
const LANE: &str = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/../metal2vulkan-validation/src/runtime_lane"
|
||||
);
|
||||
/// The lane's module tree: `runtime_lane.rs` and every `.rs` file below `runtime_lane/`, under
|
||||
/// the validation crate.
|
||||
const LANE: &str = "src/runtime_lane";
|
||||
|
||||
/// The device test whose site list this test reads, and the `let` binding that holds it.
|
||||
const DEVICE_TEST: &str = "fn every_kind_has_a_site_a_lane_test_takes()";
|
||||
@@ -48,7 +46,7 @@ struct Site {
|
||||
/// Each lane source as (path relative to the lane's directory, text): `runtime_lane.rs` beside the
|
||||
/// directory, then every `.rs` file below it, in sorted order.
|
||||
fn lane_sources() -> Vec<(String, String)> {
|
||||
let lane = PathBuf::from(LANE);
|
||||
let lane = metal2vulkan_devtools::validation_dir().join(LANE);
|
||||
let module = lane.with_extension("rs");
|
||||
let mut files = vec![module];
|
||||
collect(&lane, &mut files);
|
||||
|
||||
@@ -37,15 +37,12 @@
|
||||
use crate::{Function, Library};
|
||||
use metal2vulkan::library::{FunctionConstantValue, FunctionConstantValues};
|
||||
use metal2vulkan::metal::DataType;
|
||||
use std::path::Path;
|
||||
|
||||
/// The runtime library of the fixture `name`, loaded as the device API loads AIR: through the
|
||||
/// translator, so every function is module-sourced and its properties, constants and reflection
|
||||
/// come from its AIR, which is the shape that pays for a per-call derivation.
|
||||
fn library(device: &crate::Device, name: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine")
|
||||
.join(format!("{name}.ll"));
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(format!("{name}.ll"));
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -22,12 +22,10 @@ use super::blit_holds::{device, Scratch};
|
||||
use crate::{Device, PipelineOption, PipelineOptions, RenderPipelineState};
|
||||
use metal2vulkan::metal::PixelFormat;
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
|
||||
/// The fixture's render descriptor, one `RGBA8Unorm` target.
|
||||
pub(super) fn descriptor(device: &Device) -> RenderPipelineDescriptor {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/ubo_bind_offsets.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("ubo_bind_offsets.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -118,9 +118,7 @@ fn device(cache: &Path) -> Device {
|
||||
/// The owned fixture's kernel that loads a word no one raises until its cap
|
||||
/// (`kernel_spin_on_an_unraised_word`).
|
||||
fn spin(device: &Device) -> ComputePipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join(
|
||||
"../metal2vulkan-validation/fixtures/public/engine/kernel_spin_on_an_unraised_word.ll",
|
||||
);
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_spin_on_an_unraised_word.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -154,8 +154,7 @@ use std::ffi::{CStr, CString};
|
||||
/// Every committed profile's description at the runtime's Vulkan 1.2 instance, as `(file,
|
||||
/// description)`.
|
||||
fn descriptions() -> Vec<(std::path::PathBuf, DeviceDescription)> {
|
||||
let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut out = Vec::new();
|
||||
for entry in std::fs::read_dir(&dir).unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
|
||||
@@ -27,7 +27,6 @@ use super::blit_holds::{device, Scratch};
|
||||
use crate::pipeline::direct_arguments_from_air;
|
||||
use crate::PipelineOptions;
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
|
||||
/// A compute state of `runtime_examples`' `scale_and_offset` kernel with
|
||||
/// `supportIndirectCommandBuffers`, which is what makes the creation ask: it is made, and the
|
||||
@@ -36,8 +35,7 @@ use std::path::Path;
|
||||
fn a_creation_answers_from_its_compiled_kernel() {
|
||||
let scratch = Scratch::new("direct-arguments-from-compiled");
|
||||
let device = device(&scratch.0);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let function = device
|
||||
|
||||
@@ -92,7 +92,6 @@ use crate::{
|
||||
use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
|
||||
use std::num::NonZeroU64;
|
||||
use std::ops::Range;
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
@@ -163,8 +162,7 @@ impl DirtyPages for Log {
|
||||
}
|
||||
|
||||
fn state(device: &Device, kernel: &str) -> ComputePipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library: Library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -4,7 +4,6 @@ use super::super::driver_defects::{among, of, Affected, AFFECTED};
|
||||
use metal2vulkan::device::DeviceDescription;
|
||||
use metal2vulkan::error::RuntimeDriverDefect;
|
||||
use metal2vulkan::vk::DriverId;
|
||||
use std::path::PathBuf;
|
||||
|
||||
const COPIES: RuntimeDriverDefect = RuntimeDriverDefect::MultisampledDepthStencilColourCopies;
|
||||
const STENCIL_COPIES: RuntimeDriverDefect = RuntimeDriverDefect::MultisampledStencilColourCopies;
|
||||
@@ -77,7 +76,7 @@ const WRAPS: RuntimeDriverDefect = RuntimeDriverDefect::VertexFetchWrapsPast4GiB
|
||||
/// SwiftShader none.
|
||||
#[test]
|
||||
fn the_committed_profiles_drivers_have_their_defects() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut drivers = 0;
|
||||
for path in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
let path = path.expect("directory entry").path();
|
||||
@@ -340,7 +339,7 @@ fn the_scheduler_waits_on_the_gpu_where_no_signal_is_lost() {
|
||||
/// Each clean GPU is a committed profile's GPU of the driver.
|
||||
#[test]
|
||||
fn every_clean_gpu_is_a_committed_profiles() {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut committed = Vec::new();
|
||||
for path in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
let path = path.expect("directory entry").path();
|
||||
@@ -409,7 +408,7 @@ fn a_set_past_the_drivers_support_is_among_its_variants_kinds() {
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, FunctionDescriptor, StageSource};
|
||||
use metal2vulkan::Budget;
|
||||
|
||||
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation");
|
||||
let root = metal2vulkan_devtools::validation_dir();
|
||||
let ll = root.join("fixtures/public/engine/hsw_storage_writes.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).expect("llvm-as");
|
||||
let text = std::fs::read_to_string(root.join("profiles/moltenvk-m3.json")).expect("profile");
|
||||
|
||||
@@ -157,9 +157,7 @@ fn run(kernel: &Kernel, dispatches: usize, pushing: Pushing, moved: bool) -> Res
|
||||
let scratch = Scratch::new();
|
||||
let device = device(&scratch.0, pushing);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(file);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(file);
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).map_err(|e| format!("{e:?}"))?;
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).map_err(|e| format!("{e}"))?;
|
||||
let function = device
|
||||
|
||||
@@ -16,8 +16,7 @@ const V1_4: ApiVersion = ApiVersion { major: 1, minor: 4 };
|
||||
/// Every committed profile's recommendation at its version capped by `instance` (an instance of
|
||||
/// Vulkan 1.2 caps every device at 1.2), as `(file, set, version)`.
|
||||
fn recommendations(instance: ApiVersion) -> Vec<(std::path::PathBuf, EnableSet, ApiVersion)> {
|
||||
let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut out = Vec::new();
|
||||
for entry in std::fs::read_dir(&dir).unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
@@ -74,8 +73,7 @@ fn every_recommended_enable_has_a_member_and_a_name() {
|
||||
/// creation (the committed profiles' recommendations cover only the features their captures read).
|
||||
#[test]
|
||||
fn every_feature_the_rules_enable_has_a_member() {
|
||||
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles/roadmap-2022.json");
|
||||
let path = metal2vulkan_devtools::validation_dir().join("profiles/roadmap-2022.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
for api in [ApiVersion::V1_2, ApiVersion::V1_3, V1_4] {
|
||||
let mut extensions: BTreeSet<VkExtension> = VkFeature::ALL
|
||||
@@ -240,8 +238,7 @@ fn members_are_unique() {
|
||||
/// nothing for a feature the description keeps without one.
|
||||
#[test]
|
||||
fn promotions_are_the_descriptions() {
|
||||
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles/roadmap-2022.json");
|
||||
let path = metal2vulkan_devtools::validation_dir().join("profiles/roadmap-2022.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let all: BTreeSet<VkFeature> = MEMBERS.iter().map(|member| member.feature).collect();
|
||||
let none = BTreeSet::new();
|
||||
|
||||
@@ -37,7 +37,6 @@ use metal2vulkan::pipeline::{
|
||||
ColorAttachmentDescriptor, ComputePipelineDescriptor, RenderPipelineDescriptor, StageSource,
|
||||
};
|
||||
use std::any::Any;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -178,15 +177,10 @@ pub(super) fn words_of(buffer: &Buffer) -> Vec<u32> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The library of the fixture at `path` under `validation/fixtures/public/`, beside the manifest
|
||||
/// directory the test runner names as the test runs (a run of an archive on another machine names
|
||||
/// its own), else the one the build named.
|
||||
/// The library of the fixture at `path` under `validation/fixtures/public/`
|
||||
/// ([`metal2vulkan_devtools::fixtures_dir`]).
|
||||
pub(super) fn library(device: &Device, path: &str) -> Library {
|
||||
let manifest = std::env::var_os("CARGO_MANIFEST_DIR")
|
||||
.map_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")), PathBuf::from);
|
||||
let ll = manifest
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(path);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(path);
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
device.new_library_with_compile_library(library)
|
||||
|
||||
@@ -39,7 +39,7 @@ fn sources() -> Vec<(PathBuf, String)> {
|
||||
}
|
||||
let mut paths = Vec::new();
|
||||
walk(
|
||||
&Path::new(env!("CARGO_MANIFEST_DIR")).join("src"),
|
||||
&metal2vulkan_devtools::workspace_dir().join("crates/metal2vulkan-runtime/src"),
|
||||
&mut paths,
|
||||
);
|
||||
paths.sort();
|
||||
|
||||
@@ -2033,7 +2033,7 @@ fn runtime_sources() -> Vec<(String, String)> {
|
||||
}
|
||||
}
|
||||
}
|
||||
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
|
||||
let root = metal2vulkan_devtools::workspace_dir().join("crates/metal2vulkan-runtime/src");
|
||||
let mut sources = Vec::new();
|
||||
walk(&root, &root, &mut sources);
|
||||
assert!(sources.len() > 50, "the runtime's sources were not found");
|
||||
|
||||
@@ -45,7 +45,6 @@ use metal2vulkan::pipeline::{
|
||||
ComputePipelineDescriptor, StageInputAttributeDescriptor, StageInputDescriptor,
|
||||
StageInputLayoutDescriptor, StageSource,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The rows each sweep makes after the warm-up's one.
|
||||
const RUN: u64 = 16;
|
||||
@@ -66,8 +65,7 @@ const SPARE: u32 = 4;
|
||||
/// The library of the fixture's kernel, on a device with an empty cache of its own.
|
||||
fn opened(scratch: &Scratch) -> (crate::Device, crate::Library) {
|
||||
let device = device(&scratch.0);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/kernel_stage_in.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_stage_in.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
use super::texture_descriptor::APPLE;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::buffer::LINEAR_IMAGE_ALIGNMENT;
|
||||
use crate::heap::{heap_size, Numbered, PLACEMENT_ALIGNMENT};
|
||||
@@ -17,7 +16,7 @@ use metal2vulkan::device::DeviceDescription;
|
||||
|
||||
/// Every committed profile's description: (file stem, description), sorted by stem.
|
||||
fn committed_descriptions() -> Vec<(String, DeviceDescription)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut out: Vec<(String, DeviceDescription)> = std::fs::read_dir(&dir)
|
||||
.expect("validation/profiles is readable")
|
||||
.map(|e| e.expect("directory entry").path())
|
||||
|
||||
@@ -84,9 +84,7 @@ const WRITER: &str = "kernel_icb_encode_render_commands";
|
||||
/// command `t` on the GPU (`air.reset_render_command`); then an even `t` encodes what the fixture
|
||||
/// does (its vertex and fragment buffers and its draw), and an odd one nothing.
|
||||
fn reset_writer_text(reset: bool) -> String {
|
||||
let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(format!("{WRITER}.ll"));
|
||||
let path = metal2vulkan_devtools::fixtures_dir().join(format!("{WRITER}.ll"));
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let define = text.find(&format!("define void @{WRITER}(")).unwrap();
|
||||
let open = define + text[define..].find("{\n").unwrap() + 2;
|
||||
|
||||
@@ -34,11 +34,10 @@ use metal2vulkan::vk::{
|
||||
ImageUsageFlags, SampleCountFlags,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Every committed profile's description and compile device (`validation/profiles/`).
|
||||
pub(super) fn committed() -> Vec<(String, DeviceDescription, Device)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut out: Vec<(String, DeviceDescription, Device)> = std::fs::read_dir(&dir)
|
||||
.expect("validation/profiles is readable")
|
||||
.map(|e| e.expect("directory entry").path())
|
||||
|
||||
@@ -11,7 +11,6 @@ use metal2vulkan::pipeline::{
|
||||
};
|
||||
use metal2vulkan::vk::ShaderStage;
|
||||
use metal2vulkan::Budget;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// The fragment and vertex stages' facts of each fragment function of
|
||||
/// `ipo_primitive_order` (`validation/fixtures/public/engine`, `llvm-as`) drawn after `ipo_fan`
|
||||
@@ -22,7 +21,7 @@ use std::path::PathBuf;
|
||||
/// storage image, `ipo_mix` its attachment's. No vertex stage interlocks.
|
||||
#[test]
|
||||
fn the_translators_fragment_stages_state_their_interlocked_writes() {
|
||||
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation");
|
||||
let root = metal2vulkan_devtools::validation_dir();
|
||||
let ll = root.join("fixtures/public/engine/ipo_primitive_order.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).expect("llvm-as");
|
||||
let text = std::fs::read_to_string(root.join("profiles/moltenvk-m3.json")).expect("profile");
|
||||
|
||||
@@ -31,7 +31,6 @@ use metal2vulkan::metal::{
|
||||
};
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::Path;
|
||||
use std::time::Duration;
|
||||
|
||||
/// The commands the page encodes and executes: two chunks' (`kept_commands::CHUNK` is 256).
|
||||
@@ -63,9 +62,7 @@ fn buffer_with(device: &Device, bytes: &[u8]) -> Buffer {
|
||||
|
||||
impl Page {
|
||||
fn new(device: &Device) -> Page {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join(
|
||||
"../metal2vulkan-validation/fixtures/public/engine/icb_vertex_encode_textured.ll",
|
||||
);
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("icb_vertex_encode_textured.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -35,7 +35,6 @@ use crate::{Device, Function, Library, PipelineOptions, WorkCounts};
|
||||
use metal2vulkan::library::{FunctionConstantValue, FunctionConstantValues};
|
||||
use metal2vulkan::metal::{DataType, PixelFormat};
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// The distinct states each round makes: past a guest's median reuse distance (51), well past
|
||||
@@ -44,9 +43,7 @@ const STATES: usize = 64;
|
||||
|
||||
/// The library of the owned fixture `name` on `device`.
|
||||
pub(super) fn library(device: &Device, name: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine")
|
||||
.join(format!("{name}.ll"));
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(format!("{name}.ll"));
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -11,7 +11,6 @@ use metal2vulkan::library::{CompiledFunction, Library};
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, FunctionDescriptor, Stage, StageSource};
|
||||
use metal2vulkan::Budget;
|
||||
use std::collections::HashSet;
|
||||
use std::path::Path;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
/// A fixed sequence of pseudo-random numbers (xorshift).
|
||||
@@ -252,12 +251,12 @@ fn using_the_latest_entry_again_keeps_the_order() {
|
||||
/// The owned `ob3_texture_array` kernel, from its committed AIR, compiled for the committed
|
||||
/// MoltenVK profile, and that device.
|
||||
fn texture_array() -> (Device, CompiledFunction) {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
let air = root.join("../metal2vulkan-validation/fixtures/public/engine/ob3_texture_array.air");
|
||||
let air = metal2vulkan_devtools::engine_dir().join("ob3_texture_array.air");
|
||||
let bitcode = std::fs::read(air).expect("the committed AIR");
|
||||
let text =
|
||||
std::fs::read_to_string(root.join("../metal2vulkan-validation/profiles/moltenvk-m3.json"))
|
||||
.expect("profile");
|
||||
let text = std::fs::read_to_string(
|
||||
metal2vulkan_devtools::validation_dir().join("profiles/moltenvk-m3.json"),
|
||||
)
|
||||
.expect("profile");
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let device = Device::new(description, DevicePolicy::default()).expect("device");
|
||||
let function = Library::from_air(&bitcode)
|
||||
|
||||
@@ -56,8 +56,7 @@ impl Drop for Scratch {
|
||||
/// with two `RGBA32Uint` targets: three module-sourced stages, so its reflection comes from their
|
||||
/// AIR, which is what a per-state derivation pays for.
|
||||
fn descriptor() -> MeshPipelineDescriptor {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/mesh_draws.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("mesh_draws.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let stage =
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
//! Some read the repository beside this crate: device profiles from `../validation/profiles`,
|
||||
//! fixtures from `../validation/fixtures`, and `../docs`. They run only from the workspace
|
||||
//! checkout, not from a packaged crate; the crate's build (its build script and `include_str!`)
|
||||
//! reads nothing outside its own directory.
|
||||
//! reads nothing outside its own directory. They find the checkout through
|
||||
//! `metal2vulkan_devtools::workspace_dir` and the helpers on it, where the test runner names it,
|
||||
//! so an archive built on one machine runs on another (`--workspace-remap`).
|
||||
|
||||
#[cfg(any(m2v_gpu, m2v_cpu_icd))]
|
||||
mod a8_over_buffers;
|
||||
|
||||
@@ -152,8 +152,7 @@ fn threads_that_first_ask_at_once_share_one_zero_buffer() {
|
||||
}
|
||||
|
||||
fn state(device: &Device, fragment: &str) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
@@ -281,8 +280,7 @@ fn dispatched(dispatches: usize, unbound: u64) -> (u64, crate::WorkCounts, crate
|
||||
let scratch = Scratch::new();
|
||||
let device = device(&scratch.0);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let function = device
|
||||
|
||||
@@ -23,13 +23,10 @@ use metal2vulkan::library::{FunctionConstantValue, FunctionConstantValues, Libra
|
||||
use metal2vulkan::metal::DataType;
|
||||
use metal2vulkan::pipeline::{LinkedFunction, LinkedFunctions, SpecKey};
|
||||
use metal2vulkan::vk::SpecializationMapEntry;
|
||||
use std::path::Path;
|
||||
|
||||
/// The one function of committed AIR fixture `stem`, as a linked function.
|
||||
fn linked(stem: &str) -> LinkedFunction {
|
||||
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine")
|
||||
.join(format!("{stem}.air"));
|
||||
let path = metal2vulkan_devtools::engine_dir().join(format!("{stem}.air"));
|
||||
let bitcode = std::fs::read(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let library = Library::from_air(&bitcode).expect("library");
|
||||
LinkedFunction::new(library.function(stem).expect("function"))
|
||||
@@ -231,8 +228,7 @@ fn a_pipelines_constants_take_the_keys_values_else_their_defaults() {
|
||||
/// bind offset.
|
||||
#[test]
|
||||
fn every_committed_driver_reads_its_uniform_views_at_their_residuals() {
|
||||
let dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles");
|
||||
let dir = metal2vulkan_devtools::validation_dir().join("profiles");
|
||||
let mut read = 0;
|
||||
for entry in std::fs::read_dir(&dir).expect("validation/profiles is readable") {
|
||||
let path = entry.expect("directory entry").path();
|
||||
|
||||
@@ -97,8 +97,7 @@ fn state(device: &Device) -> RenderPipelineState {
|
||||
|
||||
/// [`state`]'s, its target blended where `blended`: a state of other pipelines.
|
||||
fn blended_state(device: &Device, blended: bool) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -21,7 +21,6 @@ use metal2vulkan::pipeline::{
|
||||
ComputePipelineDescriptor, StageInputAttributeDescriptor, StageInputDescriptor,
|
||||
StageInputLayoutDescriptor, StageSource,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The creations the warm-up makes: the first makes the blocks the pools lack, the second finds
|
||||
/// them and derives each pool's longest free range, and the third reads what the second held.
|
||||
@@ -66,8 +65,7 @@ fn create(device: &crate::Device, library: &crate::Library, step: u32) {
|
||||
#[test]
|
||||
fn a_run_of_creations_derives_the_pools_room_no_further() {
|
||||
let device = crate::Device::system_default().unwrap();
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/kernel_stage_in.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_stage_in.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -11,7 +11,6 @@ use super::blit_holds::{device, Scratch};
|
||||
use crate::{IndirectCommandBufferDescriptor, PipelineOptions, ResourceId, ResourceOptions};
|
||||
use metal2vulkan::metal::IndirectCommandType;
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
|
||||
/// The states made and released on one ID.
|
||||
const CYCLES: usize = 1000;
|
||||
@@ -24,8 +23,7 @@ const CYCLES: usize = 1000;
|
||||
fn a_buffer_keeps_at_most_four_released_programs_of_an_id() {
|
||||
let scratch = Scratch::new("released-programs");
|
||||
let device = device(&scratch.0);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let function = device
|
||||
|
||||
@@ -18,7 +18,6 @@ use crate::{
|
||||
use ash::vk;
|
||||
use metal2vulkan::metal::{IndirectCommandType, ResourceUsage};
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use std::path::Path;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -50,8 +49,7 @@ fn device() -> Device {
|
||||
/// A state of the fixture's `scale_and_offset` that an indirect command buffer's commands may
|
||||
/// set.
|
||||
fn state(device: &Device) -> ComputePipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -26,7 +26,6 @@ use crate::{
|
||||
ResourceOptions, Size, Texture, TextureDescriptor,
|
||||
};
|
||||
use metal2vulkan::metal::{PixelFormat, TextureUsage};
|
||||
use std::path::Path;
|
||||
|
||||
/// The texture: `WIDTH` texels a row, `HEIGHT` rows, rows of `ROW` bytes.
|
||||
const WIDTH: u64 = 68;
|
||||
@@ -51,9 +50,7 @@ fn inverted(x: u64, y: u64) -> [u8; 4] {
|
||||
|
||||
/// The `invert_texels` pipeline of the owned fixture.
|
||||
fn invert(device: &Device) -> ComputePipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join("examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library: Library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -67,9 +67,7 @@ const CPU_BYTES: [u8; 4] = [1, 2, 3, 4];
|
||||
|
||||
/// The library of the fixture at `path` under `validation/fixtures/public/`.
|
||||
fn library(device: &Device, path: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(path);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(path);
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
device.new_library_with_compile_library(library)
|
||||
|
||||
@@ -26,7 +26,6 @@ use crate::{
|
||||
ResourceOptions, Size, TextureDescriptor,
|
||||
};
|
||||
use metal2vulkan::metal::{PixelFormat, TextureUsage};
|
||||
use std::path::Path;
|
||||
|
||||
/// The texture: `WIDTH` texels a row (more than one workgroup of the merge's kernel, 256
|
||||
/// texels), `HEIGHT` rows, rows of `ROW` bytes.
|
||||
@@ -71,9 +70,7 @@ fn written_before(x: u64) -> [u8; 4] {
|
||||
|
||||
/// The library of the fixture at `path` under `validation/fixtures/public/`.
|
||||
fn library(device: &Device, path: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(path);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(path);
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
device.new_library_with_compile_library(library)
|
||||
|
||||
@@ -36,7 +36,6 @@ use metal2vulkan::pipeline::{
|
||||
ComputePipelineDescriptor, StageInputAttributeDescriptor, StageInputDescriptor,
|
||||
StageInputLayoutDescriptor, StageSource,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The siblings the run makes after the warm-up's one.
|
||||
const RUN: u64 = 16;
|
||||
@@ -84,8 +83,7 @@ const ASKS: u64 = 2;
|
||||
fn a_run_of_compute_creations_specializes_one_kernel_once() {
|
||||
let scratch = Scratch::new("stage-entries-shared");
|
||||
let device = device(&scratch.0);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/kernel_stage_in.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_stage_in.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = device.new_library_with_compile_library(
|
||||
metal2vulkan::library::Library::from_air(&bitcode).unwrap(),
|
||||
|
||||
@@ -230,8 +230,7 @@ fn watched(cache: &Path) -> (Device, Ending) {
|
||||
/// (`pipeline/predicted.rs`), which a triangle strip shares where the topology is dynamic, and not
|
||||
/// a line strip's, of another class.
|
||||
fn state(device: &Device) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -62,8 +62,7 @@ fn device(cache: &Path) -> Device {
|
||||
/// The fixture's render pipeline state: `colored_vertex` and `colored_fragment`, writing an
|
||||
/// `RGBA8Unorm` color 0, beside a color 1 of `second` it does not write.
|
||||
fn state(device: &Device, second: PixelFormat) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let library = device.new_library_with_compile_library(library);
|
||||
|
||||
@@ -28,7 +28,6 @@ use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureUsage};
|
||||
use metal2vulkan::pipeline::{
|
||||
ColorAttachmentDescriptor, ComputePipelineDescriptor, RenderPipelineDescriptor, StageSource,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's side, in pixels.
|
||||
const SIDE: u64 = 4;
|
||||
@@ -55,8 +54,7 @@ impl Bound {
|
||||
}
|
||||
|
||||
fn library(device: &Device) -> crate::Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine/ubo_bind_offsets.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("ubo_bind_offsets.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
device.new_library_with_compile_library(library)
|
||||
|
||||
@@ -149,8 +149,7 @@ fn cleared(command_buffers: usize, dispatches: usize) -> (u64, u64) {
|
||||
let scratch = Scratch::new("upload-sweep");
|
||||
let device = device(&scratch.0);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
let function = device
|
||||
|
||||
@@ -557,9 +557,7 @@ fn a_raw_submission_is_ordered_by_a_shared_event_s_semaphore() {
|
||||
|
||||
/// The library of the fixture at `path` under `validation/fixtures/public/`.
|
||||
fn library(device: &Device, path: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public")
|
||||
.join(path);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(path);
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap();
|
||||
device.new_library_with_compile_library(library)
|
||||
|
||||
@@ -122,8 +122,7 @@ fn device(
|
||||
/// The compute descriptor of `runtime_examples`' `scale_and_offset`, requiring its threadgroup
|
||||
/// (so its creation makes its first dispatch's `VkPipeline`).
|
||||
fn compute(device: &Device) -> ComputePipelineDescriptor {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap();
|
||||
let function = device
|
||||
.new_library_with_compile_library(
|
||||
|
||||
@@ -18,13 +18,10 @@ use metal2vulkan::pipeline::{
|
||||
};
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
|
||||
/// The library of the committed AIR of fixture `stem`.
|
||||
fn library(stem: &str) -> Library {
|
||||
let air = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/fixtures/public/engine")
|
||||
.join(format!("{stem}.air"));
|
||||
let air = metal2vulkan_devtools::engine_dir().join(format!("{stem}.air"));
|
||||
Library::from_air(&std::fs::read(air).expect("the committed AIR")).expect("a library")
|
||||
}
|
||||
|
||||
|
||||
@@ -1599,7 +1599,7 @@ impl LaneChecks {
|
||||
|
||||
/// The names of the committed cases whose AIR is a public fixture, in shard order.
|
||||
pub fn public_case_names() -> Result<Vec<String>, String> {
|
||||
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let public: std::collections::HashSet<(String, String)> = crate::source::public_sources()?
|
||||
.into_iter()
|
||||
@@ -1660,7 +1660,7 @@ pub type NamedCase = (String, Result<PublicCase, String>);
|
||||
/// Each committed case `select` takes, in shard order ([`NamedCase`]); one pass over the case
|
||||
/// shards and the public fixtures.
|
||||
pub fn public_cases(select: impl Fn(&AuthoredCase) -> bool) -> Result<Vec<NamedCase>, String> {
|
||||
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let mut selected = Vec::new();
|
||||
for shard in 0..64 {
|
||||
|
||||
@@ -55,7 +55,6 @@ use metal2vulkan_runtime::{
|
||||
VisibilityResultMode,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::Path;
|
||||
|
||||
/// The kind a draw of one amplification at a time takes, announced once per device.
|
||||
pub(super) const AMPLIFICATION: [Degradation; 1] = [Degradation::AmplificationDraws];
|
||||
@@ -272,8 +271,7 @@ struct Lane {
|
||||
impl Lane {
|
||||
/// The lane on `device`; `Err` with the device's refusal of an amplified pipeline.
|
||||
fn new(device: Device) -> Result<Lane, Error> {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rt6_amplified.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_amplified.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -78,7 +78,6 @@ use metal2vulkan_runtime::{
|
||||
ResourceOptions, ResourceRef, ScissorRect, Size, StoreAction, Texture, TextureDescriptor,
|
||||
WorkCounts,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
use std::time::Duration;
|
||||
|
||||
const WAIT: Duration = Duration::from_secs(60);
|
||||
@@ -92,12 +91,9 @@ const BEFORE: u8 = 64;
|
||||
/// The red draw A writes.
|
||||
const DRAWN: u8 = 128;
|
||||
|
||||
/// A function of the fixture `fixture` under `fixtures/public/engine`, of the crate's directory
|
||||
/// as the test runner names it (a carried archive's run remaps it), else as the build did.
|
||||
/// A function of the engine fixture `fixture` ([`metal2vulkan_devtools::engine_dir`]).
|
||||
pub(super) fn function(device: &Device, name: &str, fixture: &str) -> StageSource {
|
||||
let manifest = std::env::var_os("CARGO_MANIFEST_DIR")
|
||||
.map_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")), PathBuf::from);
|
||||
let ll = manifest.join("fixtures/public/engine").join(fixture);
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(fixture);
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -20,12 +20,10 @@ use metal2vulkan_runtime::{
|
||||
CommandBufferError, CommandBufferStatus, CommandQueue, Device, Error, EventRef, Library,
|
||||
PipelineOptions, RenderPassDescriptor, RenderPipelineState, ScissorRect,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The fixture's library on `device`.
|
||||
fn library(device: &Device) -> Library {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rt6_attachmentless.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_attachmentless.ll");
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -49,7 +49,6 @@ use metal2vulkan_runtime::{
|
||||
PipelineOptions, Region, RenderCommandEncoder, RenderPassDescriptor, RenderPipelineState,
|
||||
ResourceOptions, RuntimeGap, SamplerState, Size, StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The probe's usage of the textures it renders.
|
||||
const RT: TextureUsage = TextureUsage::SHADER_READ
|
||||
@@ -173,8 +172,7 @@ struct Lane {
|
||||
|
||||
impl Lane {
|
||||
fn new(device: &Device) -> Lane {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let bitcode = llvm_assemble(&ll).unwrap();
|
||||
Lane {
|
||||
queue: device.new_command_queue().unwrap(),
|
||||
@@ -1099,8 +1097,7 @@ fn executed(lane: &Lane, kind: Kind, before: Before, bpr: u64) {
|
||||
let device = &lane.device;
|
||||
let rgba = PixelFormat::RGBA8Unorm;
|
||||
let read = lane.pipeline(("tob_rect", "tob_read"), rgba, 1);
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/icb_render_replay_template.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("icb_render_replay_template.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -73,7 +73,6 @@ use metal2vulkan_runtime::{
|
||||
};
|
||||
use std::cell::Cell;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
use std::time::Instant;
|
||||
|
||||
/// The program's live buffers of the working set, each [`BUFFER_BYTES`] long.
|
||||
@@ -173,8 +172,7 @@ const RECT: [f32; 4] = [-0.5, -0.5, 0.5, 0.5];
|
||||
impl Workload {
|
||||
pub(super) fn new(device: Device) -> Workload {
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -38,11 +38,10 @@ use metal2vulkan_runtime::{
|
||||
CommandBufferStatus, CommandQueue, Device, Error, Library, PipelineOptions,
|
||||
RenderPassDescriptor, RenderPipelineState,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The fixture's library on `device`.
|
||||
fn library(device: &Device) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/coverage_loop.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("coverage_loop.ll");
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -72,8 +72,6 @@ use metal2vulkan_runtime::{
|
||||
};
|
||||
#[cfg(any(m2v_cpu_icd, m2v_gpu_hazards))]
|
||||
use metal2vulkan_runtime::{ComputeCommandEncoder, ComputePipelineState, PipelineOptions, Size};
|
||||
#[cfg(any(m2v_cpu_icd, m2v_gpu_hazards))]
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -114,8 +112,7 @@ impl Spin {
|
||||
/// commit to completion, until one takes [`MEASURED`], scaled to [`SLICE`]. The first, not
|
||||
/// timed, makes the pipeline's `VkPipeline`, so no later dispatch of it waits at a host step.
|
||||
fn new(device: &Device) -> Spin {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/kernel_spin_on_an_unraised_word.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_spin_on_an_unraised_word.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -46,7 +46,6 @@ use metal2vulkan_runtime::{
|
||||
LoadAction, PipelineOptions, Region, RenderPassDescriptor, RenderPipelineState,
|
||||
ResourceOptions, SamplerState, Size, StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::time::Instant;
|
||||
|
||||
/// The timed runs of each case.
|
||||
@@ -69,9 +68,7 @@ const DISPATCHES: usize = 16;
|
||||
|
||||
/// The engine fixture `stem`'s library on `device`.
|
||||
fn library(device: &Device, stem: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine")
|
||||
.join(format!("{stem}.ll"));
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(format!("{stem}.ll"));
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -39,7 +39,6 @@ use metal2vulkan_runtime::{
|
||||
PipelineOptions, RenderPassDescriptor, RenderPipelineState, ResourceOptions, StoreAction,
|
||||
Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::time::Instant;
|
||||
|
||||
/// The timed frames of each case, and the untimed ones before them.
|
||||
@@ -69,8 +68,7 @@ impl Kit {
|
||||
/// The kit of `samples`, its depth a heap's where `in_heap`, and of `ShaderRead` usage too
|
||||
/// where `read` (so that binding it for reading takes no image of its own).
|
||||
fn new(device: &Device, samples: u64, in_heap: bool, read: bool) -> Kit {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/rt6_render_state.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_render_state.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -35,7 +35,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, ClearColor, LoadAction, PipelineOptions, RenderPassDescriptor, RenderPipelineState,
|
||||
ResourceOptions, StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's width and height.
|
||||
const W: u64 = 8;
|
||||
@@ -46,8 +45,7 @@ const CLEAR: i32 = -7;
|
||||
|
||||
/// The fixture's pipeline on `lane`'s device, drawing an `RGBA32Sint` target.
|
||||
fn pipeline(lane: &Lane) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/fragment_discard_counts.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("fragment_discard_counts.ll");
|
||||
let library = lane
|
||||
.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
|
||||
@@ -48,7 +48,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, ClearColor, Degradation, LoadAction, PipelineOptions, Region, RenderPassDescriptor,
|
||||
RenderPipelineState, ResourceOptions, StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's width and height.
|
||||
const W: u64 = 8;
|
||||
@@ -112,8 +111,7 @@ fn expected(shape: &str, metals: Answer, gap: bool) -> Answer {
|
||||
/// The fixture's pipeline of fragment function `fragment` on `lane`'s device, drawing an
|
||||
/// `RGBA32Sint` target.
|
||||
fn pipeline(lane: &Lane, fragment: &str) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/fragment_discard_hoist.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("fragment_discard_hoist.ll");
|
||||
let library = lane
|
||||
.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
|
||||
@@ -46,7 +46,7 @@ enum Issued {
|
||||
/// observation in the lane's environment.
|
||||
fn cases() -> Vec<(AuthoredCase, Vec<u8>)> {
|
||||
let source = format!("{}/engine/{FIXTURE}", crate::source::PUBLIC_FIXTURE_DIR);
|
||||
let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let mut out = Vec::new();
|
||||
for shard in 0..64 {
|
||||
|
||||
@@ -143,13 +143,11 @@ use metal2vulkan_runtime::{
|
||||
Error as RuntimeError, LoadAction, Origin, PipelineOptions, RenderPassDescriptor,
|
||||
ResourceOptions, Size, StoreAction, TextureDescriptor,
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// The owned fixture at `name` under `validation/fixtures/public/engine`.
|
||||
fn fixture(name: &str) -> PathBuf {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine")
|
||||
.join(name)
|
||||
metal2vulkan_devtools::engine_dir().join(name)
|
||||
}
|
||||
|
||||
/// Whether `device`'s profile takes `deviation`.
|
||||
@@ -470,7 +468,7 @@ const LANES: u64 = 72;
|
||||
|
||||
/// The output of `case`'s Metal row in `environment`.
|
||||
fn metal_row(case: &PublicCase, environment: &str) -> Vec<u8> {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let row = MetalObservation::current(
|
||||
store.read_metal_of_case(&case.case).unwrap(),
|
||||
@@ -2331,7 +2329,7 @@ const VERTEX_SIMDGROUP_FIXTURES: [&str; 3] = [
|
||||
/// lane's environment (the M3 Max's; the M4 drew the same words).
|
||||
fn fixture_cases(name: &str) -> Vec<(AuthoredCase, Vec<u8>)> {
|
||||
let source = format!("{}/engine/{name}", crate::source::PUBLIC_FIXTURE_DIR);
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let mut out = Vec::new();
|
||||
for shard in 0..64 {
|
||||
|
||||
@@ -32,7 +32,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, Device, LoadAction, Origin, PipelineOptions, RenderPassDescriptor, ResourceOptions,
|
||||
Size, StoreAction, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's side.
|
||||
const SIDE: u64 = 64;
|
||||
@@ -51,8 +50,7 @@ const FILLED: u32 = 0x3e3e_3e3e;
|
||||
/// How many of the target's texels held [`FILLED`] and [`BEFORE`] after one wait before
|
||||
/// `stages`, on `device`.
|
||||
fn run(device: &Device, stages: RenderStages) -> (usize, usize) {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rt6_render_state.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_render_state.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -43,7 +43,6 @@ use metal2vulkan_runtime::{
|
||||
LoadAction, Origin, PipelineOptions, RenderPassDescriptor, RenderPipelineState,
|
||||
ResourceOptions, SamplerState, Size, StorageMode, StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::time::Instant;
|
||||
|
||||
/// The timed runs of each case.
|
||||
@@ -61,9 +60,7 @@ const Z: f32 = 0.5;
|
||||
|
||||
/// The engine fixture `stem`'s library on `device`.
|
||||
fn library(device: &Device, stem: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine")
|
||||
.join(format!("{stem}.ll"));
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(format!("{stem}.ll"));
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -87,7 +87,6 @@ use metal2vulkan_runtime::{
|
||||
};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::num::NonZeroU64;
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
@@ -163,8 +162,7 @@ impl Busy {
|
||||
/// master's gate at 409546f2: a test of a 0.5 s busy work took 0.35 s whole, and its calls
|
||||
/// saw the end mark).
|
||||
pub(super) fn new(device: &Device, queue: &CommandQueue) -> Busy {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rfs_agx_yield.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rfs_agx_yield.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -37,7 +37,6 @@ use metal2vulkan_runtime::{
|
||||
ExecutedPipeline, LoadAction, Origin, PipelineOptions, RenderPassDescriptor,
|
||||
RenderPipelineState, ResourceOptions, Size, StoreAction, Texture, TextureDescriptor, Viewport,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's width and height.
|
||||
const SIDE: u64 = 8;
|
||||
@@ -198,8 +197,7 @@ struct Lane {
|
||||
impl Lane {
|
||||
/// The lane on `device`, or the device's refusal of the fixture's pipelines.
|
||||
fn new(device: Device) -> Result<Lane, Error> {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/rt6_first_vertex.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_first_vertex.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -1647,8 +1647,7 @@ fn binary_functions_link_as_plain_metal_links_them() {
|
||||
not_precompiled("new_render_pipeline_state", "")
|
||||
);
|
||||
// A mesh pipeline's mesh and object stages.
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_direct_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_direct_arguments.ll");
|
||||
let mesh_library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -21,7 +21,6 @@ use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{
|
||||
CommandBufferStatus, CommandQueue, ComputePipelineState, Device, PipelineOptions, Size,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The threads, all in one threadgroup.
|
||||
const THREADS: usize = 8;
|
||||
@@ -55,8 +54,7 @@ const NULL: [[f32; 4]; THREADS] = [
|
||||
|
||||
/// The fixture's `entry`, made into a pipeline.
|
||||
fn pipeline(device: &Device, entry: &str) -> ComputePipelineState {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/generic_pointers.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("generic_pointers.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -18,12 +18,10 @@ use metal2vulkan::metal::PixelFormat;
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{Error, Function, GpuFamily, PipelineOptions, RenderPipelineState};
|
||||
use std::path::Path;
|
||||
|
||||
/// The function `name` of the owned fixture `stem` on `lane`'s device.
|
||||
fn function(lane: &Lane, stem: &str, name: &str) -> Function {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join(format!("fixtures/public/engine/{stem}.ll"));
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(format!("{stem}.ll"));
|
||||
lane.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -39,7 +39,6 @@ use metal2vulkan_runtime::{
|
||||
RenderPassDescriptor, RenderPipelineState, ResourceOptions, StoreAction, Texture,
|
||||
TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The target's width and height.
|
||||
pub(super) const W: u64 = 32;
|
||||
@@ -279,8 +278,7 @@ fn compare(
|
||||
fn side_effects_after_a_discard_land_at_the_kept_pixels_alone() {
|
||||
let (messages, _cache, lane) = lane();
|
||||
let name = lane.device.name().to_owned();
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rch_guarded_effects.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rch_guarded_effects.ll");
|
||||
let library = lane
|
||||
.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
|
||||
@@ -54,7 +54,6 @@ use metal2vulkan_runtime::{
|
||||
RenderPassDescriptor, ResourceOptions, RuntimeGap, Size, StoreAction, Texture,
|
||||
TextureDescriptor, WorkCounts,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The kinds a texture in a heap over host pages laid out otherwise than Metal's tiles takes, each
|
||||
/// counted per texture and announced once per device with the first's ID.
|
||||
@@ -672,8 +671,7 @@ fn a_texture_made_again_beside_dispatches_takes_its_moves_pool_back() {
|
||||
fn a_command_writing_a_tiled_texture_two_ways_keeps_both_writes() {
|
||||
on_device(|device, messages| {
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -768,8 +766,7 @@ fn a_command_writing_a_tiled_texture_two_ways_keeps_both_writes() {
|
||||
fn a_tiled_texture_s_merges_take_kept_scratches_unzeroed() {
|
||||
on_device(|device, _| {
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -39,7 +39,6 @@ use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{
|
||||
BlitOption, Library, PipelineOptions, RenderPassDescriptor, RenderPipelineState,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The sampled texture's side.
|
||||
const TILE: u64 = 8;
|
||||
@@ -64,8 +63,7 @@ const DRAWS: usize = 32;
|
||||
const RUNS: usize = 5;
|
||||
|
||||
fn library(lane: &Lane) -> Library {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rch_helper_select.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rch_helper_select.ll");
|
||||
lane.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -36,7 +36,6 @@ use metal2vulkan::vk;
|
||||
use metal2vulkan::Budget;
|
||||
use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{BlitOption, Library, PipelineOptions, RenderPassDescriptor};
|
||||
use std::path::Path;
|
||||
|
||||
/// The sampled texture's side.
|
||||
const TILE: u64 = 8;
|
||||
@@ -192,8 +191,7 @@ fn a_write_after_a_helper_branch_is_lost_only_where_noted() {
|
||||
.contains(&DriverWorkaround::DiscardDropsSimdgroupStores);
|
||||
let fragment = &profile.subgroups().fragment;
|
||||
let shuffles = fragment.supported && fragment.ops.contains(OpBits::SHUFFLE);
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rch_helper_tangle.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rch_helper_tangle.ll");
|
||||
let library = lane
|
||||
.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
|
||||
@@ -3182,8 +3182,7 @@ fn the_indexed_patch_setter_refuses_what_metal_refuses() {
|
||||
#[test]
|
||||
fn states_whose_functions_use_a_direct_texture_or_sampler_are_refused_as_metal_refuses_them() {
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_direct_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_direct_arguments.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -3463,8 +3462,7 @@ fn the_gpu_written_flag_is_set_by_a_write_use_beside_an_encoding_state_or_a_blit
|
||||
#[test]
|
||||
fn states_whose_arguments_reflection_is_unmeasured_are_answered_from_their_roles() {
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_direct_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_direct_arguments.ll");
|
||||
let text = std::fs::read_to_string(&ll).unwrap();
|
||||
let mut unmeasured = text.clone();
|
||||
for (from, to) in [
|
||||
@@ -3590,8 +3588,7 @@ fn linked_vertex_and_mesh_functions_are_refused_where_metal_keeps_their_texture(
|
||||
}
|
||||
use Answer::{Made, Refused, Unrasterized};
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_linked_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_linked_arguments.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -3840,8 +3837,7 @@ fn fragment_functions_are_refused_where_metal_keeps_their_texture_and_unproven_u
|
||||
}
|
||||
use Answer::{Made, Refused, Unproven};
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_linked_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_linked_arguments.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -4107,8 +4103,7 @@ fn fragment_functions_are_linked_with_or_without_rasterization_as_metal_links_th
|
||||
}
|
||||
use Answer::{Depth, Made, Refused, Unwritten};
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_linked_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_linked_arguments.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -48,7 +48,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, Buffer, CommandBuffer, CommandBufferStatus, CommandQueue, ComputePipelineState,
|
||||
Device, Origin, PipelineOptions, Size, Texture, WorkCounts,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// The commands each page encodes and executes: two chunks' (the runtime's
|
||||
@@ -306,8 +305,7 @@ impl Spin {
|
||||
/// `queue`, from commit to completion, until one takes [`MEASURED`], scaled to [`SLICE`]. The
|
||||
/// first, not timed, makes the pipeline's `VkPipeline`.
|
||||
fn new(device: &Device, queue: &CommandQueue) -> Spin {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/kernel_spin_on_an_unraised_word.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_spin_on_an_unraised_word.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -26,7 +26,6 @@ use metal2vulkan_runtime::{
|
||||
ResourceOptions, Size, StoreAction, Texture, TextureDescriptor, WorkCounts,
|
||||
};
|
||||
use std::alloc::Layout;
|
||||
use std::path::Path;
|
||||
use std::ptr::NonNull;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
@@ -51,9 +50,7 @@ fn library(device: &Device) -> Library {
|
||||
|
||||
/// The library of the owned fixture `fixtures/public/<path>` on `device`.
|
||||
fn fixture_library(device: &Device, path: &str) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public")
|
||||
.join(path);
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join(path);
|
||||
let bitcode = llvm_assemble(&ll).unwrap();
|
||||
device.new_library_with_air(&bitcode).unwrap()
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ use metal2vulkan_runtime::{
|
||||
ResolveTarget, ResourceOptions, Size, StorageMode, StoreAction, Texture, TextureDescriptor,
|
||||
VertexAmplificationViewMapping,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The targets' width and height.
|
||||
const SIDE: u64 = 4;
|
||||
@@ -175,8 +174,7 @@ impl Lane {
|
||||
/// The lane on `device` drawing with `fragment`; `Err` with the device's refusal of the
|
||||
/// fixture's pipeline.
|
||||
fn new(device: Device, fragment: Fragment) -> Result<Lane, Error> {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/rt6_layered.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_layered.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -1114,9 +1112,7 @@ impl Steps {
|
||||
/// The lane on `device`; `Err` with the device's refusal of the fixtures' pipelines.
|
||||
fn new(device: Device) -> Result<Steps, Error> {
|
||||
let library = |name: &str| {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine")
|
||||
.join(name);
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(name);
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -31,7 +31,6 @@ use metal2vulkan_runtime::{
|
||||
ResourceOptions, SamplerState, Size, StoreAction, Texture, TextureDescriptor, WorkCounts,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::Path;
|
||||
|
||||
/// The render target's side, and the color `colored_fragment` draws with its `RGBA8Unorm` bytes.
|
||||
const SIDE: u64 = 8;
|
||||
@@ -42,8 +41,7 @@ const HALF_DRAWN: [u8; 8] = [0x00, 0x3c, 0x66, 0x32, 0x00, 0x00, 0x00, 0x3c];
|
||||
|
||||
/// The owned fixture's library on `device`.
|
||||
fn library(device: &Device) -> Library {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = llvm_assemble(&ll).unwrap();
|
||||
device.new_library_with_air(&bitcode).unwrap()
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{
|
||||
CommandBufferStatus, ComputePipelineState, Device, PipelineOptions, Size,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The `float` inputs: zeros, normals, denormals, the extremes, infinities, quiet and signaling
|
||||
/// NaNs with payloads.
|
||||
@@ -131,8 +130,7 @@ fn pipeline(device: &Device, name: &str) -> ComputePipelineState {
|
||||
|
||||
/// The owned fixture's bitcode.
|
||||
fn fixture() -> Vec<u8> {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/kernel_frexp_ilogb.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("kernel_frexp_ilogb.ll");
|
||||
llvm_assemble(&ll).unwrap()
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, ClearColor, Library, LoadAction, PipelineOptions, RenderPassDescriptor,
|
||||
RenderPipelineState, StoreAction,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The pass's color format.
|
||||
const COLOR: PixelFormat = PixelFormat::RGB10A82PXR10;
|
||||
@@ -67,7 +66,7 @@ const SECOND: [u32; 3] = [894, 639, 384];
|
||||
|
||||
/// `smw_writers`' library on `lane`'s device.
|
||||
fn library(lane: &Lane) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/smw_writers.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("smw_writers.ll");
|
||||
lane.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -40,7 +40,6 @@ use metal2vulkan_runtime::{
|
||||
Origin, PipelineOptions, RenderCommandEncoder, RenderPassDescriptor, RenderPipelineState,
|
||||
ResourceOptions, SharedEvent, Size, StoreAction, Texture, TextureDescriptor, WorkCounts,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The targets' side.
|
||||
const SIDE: u32 = 16;
|
||||
@@ -121,8 +120,7 @@ struct Kit {
|
||||
|
||||
impl Kit {
|
||||
fn new(device: &Device) -> Kit {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/rt6_render_state.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("rt6_render_state.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -551,11 +551,10 @@ fn every_normalized_code_reads_metal_s_value() {
|
||||
/// bits.
|
||||
fn recorded_rows(case: &str, site: &str) -> Vec<[u32; 4]> {
|
||||
use base64::Engine as _;
|
||||
let path = format!(
|
||||
"{}/../metal2vulkan-conformance/recordings/{case}.json",
|
||||
env!("CARGO_MANIFEST_DIR")
|
||||
);
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{path}: {e}"));
|
||||
let path = metal2vulkan_devtools::workspace_dir().join(format!(
|
||||
"crates/metal2vulkan-conformance/recordings/{case}.json"
|
||||
));
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let recording: serde_json::Value = serde_json::from_str(&text).unwrap();
|
||||
let answer = recording["answers"]
|
||||
.as_array()
|
||||
|
||||
@@ -16,7 +16,6 @@ use crate::gpu::TEST_DEVICE;
|
||||
use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource};
|
||||
use metal2vulkan_devtools::llvm_assemble;
|
||||
use metal2vulkan_runtime::{CommandBufferStatus, PipelineOptions, Size};
|
||||
use std::path::Path;
|
||||
|
||||
/// The threads, all in one threadgroup.
|
||||
const THREADS: usize = 8;
|
||||
@@ -47,8 +46,7 @@ fn a_thread_pointer_that_may_be_null_answers_as_metal() {
|
||||
let cache = ScratchCache::new().unwrap();
|
||||
{
|
||||
let device = validated_device_with(TEST_DEVICE, &messages, cache.path(), |_| {}).unwrap();
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/nullable_private.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("nullable_private.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -111,8 +111,7 @@ const MAKER_REPORT: &str = "PIPELINE-RECORDS-MAKER";
|
||||
|
||||
/// The owned fixture's library on `device`.
|
||||
fn library(device: &Device) -> Library {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/examples/runtime_examples.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/runtime_examples.ll");
|
||||
let bitcode = llvm_assemble(&ll).unwrap();
|
||||
device.new_library_with_air(&bitcode).unwrap()
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ use metal2vulkan_runtime::{
|
||||
Buffer, CommandBufferStatus, ComputePipelineState, Device, Error, PipelineOptions, Region,
|
||||
ResourceOptions, ResourceRef, Size, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The threads, all in one threadgroup.
|
||||
const THREADS: usize = 8;
|
||||
@@ -91,7 +90,7 @@ fn texture(device: &Device, texels: [f32; 4]) -> Texture {
|
||||
|
||||
/// Kernel `entry`'s pipeline, or the runtime's refusal of it.
|
||||
fn pipeline(device: &Device, entry: &str) -> Result<ComputePipelineState, Error> {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/pooled_cells.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("pooled_cells.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -30,15 +30,13 @@ use metal2vulkan_runtime::{
|
||||
RenderPassDescriptor, RenderPipelineState, ResourceOptions, StoreAction, Texture,
|
||||
TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The pass's side in pixels.
|
||||
const SIDE: u64 = 8;
|
||||
|
||||
/// The fixture's library on `device`.
|
||||
fn library(device: &Device) -> Library {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine/pdc_post_depth_coverage.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("pdc_post_depth_coverage.ll");
|
||||
device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap()
|
||||
|
||||
@@ -107,7 +107,7 @@ use metal2vulkan_runtime::{
|
||||
Buffer, CommandBuffer, CommandBufferStatus, CommandQueue, ComputePipelineState, Device,
|
||||
PipelineOptions, ResourceOptions, Size,
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Mutex, PoisonError};
|
||||
use std::time::{Duration, Instant};
|
||||
@@ -164,9 +164,7 @@ fn moltenvk_fences(device: &Device) -> bool {
|
||||
|
||||
/// The busy kernel's typed AIR text and its LLVM IR, the fixture's.
|
||||
fn fixture(extension: &str) -> PathBuf {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join(format!(
|
||||
"fixtures/public/engine/kernel_spin_on_an_unraised_word.{extension}"
|
||||
))
|
||||
metal2vulkan_devtools::engine_dir().join(format!("kernel_spin_on_an_unraised_word.{extension}"))
|
||||
}
|
||||
|
||||
/// What the storm needs of a side, the runtime or Metal: a busy command buffer, a light burst,
|
||||
|
||||
@@ -22,7 +22,6 @@ use metal2vulkan_runtime::{
|
||||
BlitOption, ClearColor, LoadAction, PipelineOptions, RenderPassDescriptor, RenderPipelineState,
|
||||
StoreAction,
|
||||
};
|
||||
use std::path::Path;
|
||||
|
||||
/// The triangles drawn, each three vertices.
|
||||
const TRIANGLES: u32 = 8;
|
||||
@@ -33,8 +32,7 @@ const CLEAR: [f32; 4] = [0.5, 0.25, 0.125, 1.0];
|
||||
/// The fixture's pipeline on `lane`'s device: `rog_order_layers` and `rog_order_output`, drawing
|
||||
/// an `RGBA16Float` target blended `d' = s + d / 2`.
|
||||
fn pipeline(lane: &Lane) -> RenderPipelineState {
|
||||
let ll =
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/fragment_rog_order.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("fragment_rog_order.ll");
|
||||
let library = lane
|
||||
.device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
|
||||
@@ -35,8 +35,7 @@ pub(super) fn refusal(call: &'static str, count: u32) -> Error {
|
||||
#[test]
|
||||
fn a_state_of_a_raster_sample_count_an_apple_gpu_lacks_is_metal_s_error_on_every_device() {
|
||||
on_device(|device| {
|
||||
let ll = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/examples/icb_direct_arguments.ll");
|
||||
let ll = metal2vulkan_devtools::fixtures_dir().join("examples/icb_direct_arguments.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
@@ -52,7 +52,6 @@ use metal2vulkan_runtime::{
|
||||
TextureDescriptor, Viewport,
|
||||
};
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::Path;
|
||||
|
||||
/// The public case whose pipeline the passes draw.
|
||||
const CASE: &str = "fragment-positions-in-a-half-quality-rate-mapped-pass";
|
||||
@@ -72,7 +71,7 @@ struct Fixture {
|
||||
|
||||
impl Fixture {
|
||||
fn new(device: &Device) -> Fixture {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("corpus");
|
||||
let root = metal2vulkan_devtools::validation_dir().join("corpus");
|
||||
let store = CorpusStore::new(&root);
|
||||
let case = (0..64)
|
||||
.flat_map(|shard| store.read_case_shard(shard).unwrap())
|
||||
|
||||
@@ -46,7 +46,6 @@ use metal2vulkan_runtime::{
|
||||
PipelineOptions, Region, RenderPassDescriptor, RenderPipelineState, ResourceOptions, Size,
|
||||
StoreAction, Texture, TextureDescriptor,
|
||||
};
|
||||
use std::path::Path;
|
||||
use std::time::Duration;
|
||||
|
||||
const WAIT: Duration = Duration::from_secs(60);
|
||||
@@ -77,7 +76,7 @@ fn atlas(device: &Device, pf: PixelFormat, usage: TextureUsage, levels: bool) ->
|
||||
|
||||
/// The `tob_rect` and `tob_sample` state into an unblended `RGBA8Unorm` color.
|
||||
pub(super) fn sampling_state(device: &Device) -> RenderPipelineState {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures/public/engine/tob_renders.ll");
|
||||
let ll = metal2vulkan_devtools::engine_dir().join("tob_renders.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
@@ -257,9 +256,7 @@ fn atlas_bytes(queue: &CommandQueue, texture: &Texture) -> Vec<u8> {
|
||||
|
||||
/// A function of the `name` fixture under `fixtures/public/engine`.
|
||||
fn function(device: &Device, name: &str, fixture: &str) -> StageSource {
|
||||
let ll = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("fixtures/public/engine")
|
||||
.join(fixture);
|
||||
let ll = metal2vulkan_devtools::engine_dir().join(fixture);
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
|
||||
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user