DevicePolicy::default() is the identity domains; the resident-table domains become RESIDENT_TABLES
What: DevicePolicy::default() now returns the identity pointer and handle domains, the policy
metal2vulkan-runtime compiles under. DevicePolicy::UNTRUSTED is renamed RESIDENT_TABLES. It stays
for the validation executor's own context (candidate/platform/compute.rs and the engine tests
that build a resident root and a handle table themselves) and for the translator's tests of that
lowering, which name it where they took default() before. The runtime takes default() instead of
setting the two fields itself.
Every tool that took default() now compiles under the runtime's policy:
- the command line's --profile;
- the compile worker;
- the authored compile census, the corpus translation audit and corpus-pipeline;
- acceptance, the tier table and specialization attempts;
- the golden table, whose devices take default() (its policy field goes).
Why: the planner's ruling (b), one policy constructor, so a tool and the runtime agree on the
policy. The description can still differ: --profile takes the profile's description, while the
runtime takes the device's, restricted to the features it enables. repro.rs and README say so.
Docs:
- README's --profile paragraph and the command's help text.
- API.md section 1: the identity domains are listed first, as the default; the resident-table
domains are the validation executor's.
- device/mod.rs, policy.rs and profile.rs.
- api_signatures.tsv renames the const.
- api_preview's buffer carries a device address equal to its gpuAddress, as the runtime makes it.
No SEMANTICS bump. For a given description and policy, the translator's output is unchanged. The
profile fingerprint covers the policy, so every cached artifact and golden cell whose output moves
does so under a changed key; the golden check reads those cells as re-keyed, a bless due. No bless
here.
Consumer search (consumer-uses.sh) at the consumer's development e76e2ffeb4 and 46 lane refs
younger than a day:
- UNTRUSTED, RESIDENT_TABLES, PointerDomain, HandleDomain and from_queries: 0 hits.
- DevicePolicy: 13 lane refs only, all in the deleted runtime's policy struct (fields this tree no
longer has); none on development.
Expected census at this commit, not yet rerun: m3-max-62608's identity column, taken at
58bea6ca1c through a scratch policy switch.
- Translation audit, of 17,206 rows: 15,176 translated on runtime-floor, 15,266 on lavapipe,
15,476 on amd-rdna3-radv and 15,459 on nvidia-rtx50-linux.
- Authored compile census: 6,266 of 7,128 cells.
Verified:
- cargo fmt --all;
- scripts/refusal-surface/refusal_surface.py leaves docs/REFUSALS.md as it was.
This commit is contained in:
1 parent
f3f661dd14
commit
2bbf157668
257 files changed
+1027
-907
No files matched your search
@@ -79,11 +79,12 @@ metal2vulkan kernel.ll kernel.spv --profile device.json --emit-meta kernel.json
|
||||
|
||||
- `--profile` is required: the crate ships no device description. Any Khronos profiles JSON works;
|
||||
[`crates/metal2vulkan-validation/profiles/`](crates/metal2vulkan-validation/profiles) has
|
||||
examples, from a bare Vulkan 1.2 device to desktop GPUs and MoltenVK. A profile compiles with the
|
||||
default domains (`DevicePolicy::UNTRUSTED`). `--device FILE` takes its place with a device
|
||||
description and policy as JSON (`{"description": ..., "policy": ...}`), which is how a runtime's
|
||||
compile device is reproduced: metal2vulkan-runtime's is the description restricted to the
|
||||
features it enables, with the identity pointer and handle domains.
|
||||
examples, from a bare Vulkan 1.2 device to desktop GPUs and MoltenVK. A profile compiles under
|
||||
the runtime's policy (`DevicePolicy::default()`, the identity pointer and handle domains), so a
|
||||
profile without `bufferDeviceAddress` and `shaderInt64` is refused. `--device FILE` takes its
|
||||
place with a device description and policy as JSON (`{"description": ..., "policy": ...}`),
|
||||
which is how a runtime's compile device is reproduced: metal2vulkan-runtime's is the
|
||||
description restricted to the features it enables, under that policy.
|
||||
- Without `--function` it compiles the library's only kernel or vertex function. A kernel with
|
||||
`--color-format` compiles as a tile pipeline. A post-tessellation vertex function adds
|
||||
`.tesc.spv` and `.tese.spv` modules; on a device without `tessellationShader` it answers
|
||||
|
||||
@@ -1414,9 +1414,7 @@ fn the_copy_moves_every_byte_in_whole_threadgroups() {
|
||||
/// it, plain or with partial threadgroups.
|
||||
#[test]
|
||||
fn the_int_cells_kernel_is_apart_in_rows_and_its_uint_control_is_not() {
|
||||
use metal2vulkan::device::{
|
||||
Device, DeviceDescription, DevicePolicy, HandleDomain, PointerDomain,
|
||||
};
|
||||
use metal2vulkan::device::{Device, DeviceDescription, DevicePolicy};
|
||||
use metal2vulkan::library::Library;
|
||||
use metal2vulkan::pipeline::{FunctionDescriptor, LoweringInputs, StageEntries};
|
||||
let air = match crate::authored::library_air() {
|
||||
@@ -1428,11 +1426,9 @@ fn the_int_cells_kernel_is_apart_in_rows_and_its_uint_control_is_not() {
|
||||
};
|
||||
let json = include_str!("../../metal2vulkan-validation/profiles/lavapipe.json");
|
||||
let description = DeviceDescription::from_khronos_json(json, None).unwrap();
|
||||
let resident = Device::from_queries(description.clone(), DevicePolicy::default()).unwrap();
|
||||
let mut policy = DevicePolicy::default();
|
||||
policy.pointer_domain = PointerDomain::Identity;
|
||||
policy.handle_domain = HandleDomain::Identity;
|
||||
let identity = Device::from_queries(description, policy).unwrap();
|
||||
let resident =
|
||||
Device::from_queries(description.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let identity = Device::from_queries(description, DevicePolicy::default()).unwrap();
|
||||
let library = Library::from_air(&air).unwrap();
|
||||
let budget = metal2vulkan::Budget::standard();
|
||||
let mut partial = LoweringInputs::new();
|
||||
|
||||
@@ -28,9 +28,7 @@ use crate::submit::{self, Work};
|
||||
use crate::submit_calls::SubmitCalls;
|
||||
use crate::times::{StampPools, Ticks};
|
||||
use ash::vk;
|
||||
use metal2vulkan::device::{
|
||||
ApiVersion, DeviceDescription, DevicePolicy, HandleDomain, PointerDomain,
|
||||
};
|
||||
use metal2vulkan::device::{ApiVersion, DeviceDescription, DevicePolicy};
|
||||
use metal2vulkan::metal::{ArgumentBuffersTier, ReadWriteTextureTier};
|
||||
use std::cell::Cell;
|
||||
use std::collections::HashMap;
|
||||
@@ -1330,10 +1328,8 @@ unsafe fn translator(
|
||||
let description = described
|
||||
.and_then(|description| description.with_enabled(&floor::shader_enables(capabilities)))
|
||||
.map_err(Error::translation)?;
|
||||
let mut policy = DevicePolicy::default();
|
||||
policy.pointer_domain = PointerDomain::Identity;
|
||||
policy.handle_domain = HandleDomain::Identity;
|
||||
metal2vulkan::device::Device::from_queries(description, policy).map_err(Error::translation)
|
||||
metal2vulkan::device::Device::from_queries(description, DevicePolicy::default())
|
||||
.map_err(Error::translation)
|
||||
}
|
||||
|
||||
/// The features device creation enables: the floor's of `capabilities`, and each of `asked` the
|
||||
|
||||
@@ -19,7 +19,7 @@ fn device(stem: &str) -> Device {
|
||||
let path = crate::engine::profiles_dir().join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
Device::from_queries(description, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
}
|
||||
|
||||
/// The module text a case maps with when its module's stage metadata declares no render target
|
||||
@@ -453,7 +453,7 @@ fn a_framebuffer_fetch_case_plans_its_ordered_input_attachment() {
|
||||
description
|
||||
.features
|
||||
.remove(&VkFeature::FragmentShaderPixelInterlock);
|
||||
let unordered = Device::from_queries(description, DevicePolicy::default()).unwrap();
|
||||
let unordered = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let (pipeline, plan, _) = planned_draw(&unordered, &render, libraries).unwrap();
|
||||
let read: Vec<u32> = (pipeline.graphics.input_attachments.iter())
|
||||
.map(|input| input.color_index)
|
||||
@@ -2116,7 +2116,7 @@ fn public_framebuffer_fetch_cases_plan_their_ordered_input_attachments() {
|
||||
// color the case reads as a storage image of its own attachment inside the interlock,
|
||||
// where the case's state lets that be exact: no input attachment, no color attachment
|
||||
// state for it, and a storage write of it in the plan. Where the state blocks that
|
||||
// form, the default policy refuses the fetch, typed.
|
||||
// form, the resident-table domains refuse the fetch, typed.
|
||||
for stem in interlocked.iter().map(String::as_str) {
|
||||
match planned_draw(&device(stem), &render, libraries) {
|
||||
Ok((pipeline, plan, _)) => {
|
||||
|
||||
@@ -21,7 +21,7 @@ pub(super) fn device(stem: &str) -> Device {
|
||||
let path = crate::engine::profiles_dir().join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
Device::from_queries(description, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
}
|
||||
|
||||
/// The committed cases whose AIR is a public fixture, with that fixture's source row.
|
||||
|
||||
@@ -1598,7 +1598,7 @@ fn a_device_buffer_array_plans_as_the_functions_buffer_table() {
|
||||
("moltenvk-m3", true),
|
||||
("runtime-floor", false),
|
||||
] {
|
||||
let device = device(stem, DevicePolicy::default());
|
||||
let device = device(stem, DevicePolicy::RESIDENT_TABLES);
|
||||
let shape = compute_shape(&compute, addressed, BufferRanges::default()).unwrap();
|
||||
let (pipeline, inputs) = variants::compile_compute_for_shape(
|
||||
&device,
|
||||
@@ -1682,7 +1682,7 @@ fn the_binder_plans_the_executors_state() {
|
||||
},
|
||||
};
|
||||
for stem in ["lavapipe", "moltenvk-m3", "runtime-floor"] {
|
||||
let device = device(stem, DevicePolicy::default());
|
||||
let device = device(stem, DevicePolicy::RESIDENT_TABLES);
|
||||
let pipeline = compile(&device, &bitcode, "count");
|
||||
for address in [
|
||||
BufferAddress::synthetic(0),
|
||||
@@ -1721,8 +1721,8 @@ fn the_binder_plans_the_executors_state() {
|
||||
|
||||
#[test]
|
||||
fn identity_is_per_profile_and_per_engine_slot() {
|
||||
let a = engine_fingerprint(device("lavapipe", DevicePolicy::default()).profile());
|
||||
let b = engine_fingerprint(device("moltenvk-m3", DevicePolicy::default()).profile());
|
||||
let a = engine_fingerprint(device("lavapipe", DevicePolicy::RESIDENT_TABLES).profile());
|
||||
let b = engine_fingerprint(device("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).profile());
|
||||
assert_ne!(a, b);
|
||||
assert_eq!(a.len(), 64);
|
||||
assert_eq!(
|
||||
@@ -2112,7 +2112,7 @@ fn a_long_replay_records_the_regions_its_dispatch_bound_holds() {
|
||||
let path = crate::engine::profiles_dir().join("gate-lavapipe.json");
|
||||
let text = std::fs::read_to_string(path).unwrap();
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let device = Device::from_queries(description, DevicePolicy::default()).unwrap();
|
||||
let device = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let variants = |n: u32| -> Vec<ReplayVariant> {
|
||||
(1..=n)
|
||||
.map(|x| ReplayVariant::new(NonZeroU64::new(7).unwrap(), [x, 1, 1], [0; 31]))
|
||||
|
||||
+3
-3
@@ -379,7 +379,7 @@ fn an_argument_buffer_texture_is_the_heap_member_its_owner_names() {
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as rejected handles.ll: {why}"),
|
||||
};
|
||||
let device = device("moltenvk-m3", DevicePolicy::default());
|
||||
let device = device("moltenvk-m3", DevicePolicy::RESIDENT_TABLES);
|
||||
let library = Library::from_air(&bitcode).unwrap();
|
||||
let function = FunctionDescriptor::new(library.function(&mapped.entry).unwrap());
|
||||
let shape = compute_shape(&mapped, true, BufferRanges::default()).unwrap();
|
||||
@@ -559,7 +559,7 @@ fn a_pipeline_state_whose_bytes_a_kernel_reads_never_reaches_a_comparison() {
|
||||
let library = Library::from_air(&bitcode).unwrap();
|
||||
let function = FunctionDescriptor::new(library.function(entry).unwrap());
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let device = device(stem, DevicePolicy::default());
|
||||
let device = device(stem, DevicePolicy::RESIDENT_TABLES);
|
||||
for addressed in [false, true] {
|
||||
let shape = compute_shape(&mapped, addressed, BufferRanges::default()).unwrap();
|
||||
let compiled = variants::compile_compute_for_shape(
|
||||
@@ -694,7 +694,7 @@ fn an_argument_buffer_sampler_is_the_sampler_table_entry_its_owner_names() {
|
||||
panic!("llvm-as rejected tail_argument_samplers.ll: {why}")
|
||||
}
|
||||
};
|
||||
let device = device("moltenvk-m3", DevicePolicy::default());
|
||||
let device = device("moltenvk-m3", DevicePolicy::RESIDENT_TABLES);
|
||||
let library = Library::from_air(&bitcode).unwrap();
|
||||
let function = FunctionDescriptor::new(library.function(&mapped.entry).unwrap());
|
||||
let shape = compute_shape(&mapped, true, BufferRanges::default()).unwrap();
|
||||
|
||||
@@ -562,7 +562,7 @@ mod tests {
|
||||
"\"shaderStorageImageWriteWithoutFormat\": false",
|
||||
);
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let device = Device::from_queries(description, DevicePolicy::default()).unwrap();
|
||||
let device = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert!(!device.profile().images().storage_write_without_format);
|
||||
|
||||
let row = crate::acceptance::row::fragment_row(
|
||||
|
||||
@@ -151,7 +151,7 @@ pub(crate) fn native_refused_on(
|
||||
) -> Result<crate::candidate::engine::RefusedOn, String> {
|
||||
let device = WorkerDevice::new(
|
||||
native.clone(),
|
||||
metal2vulkan::device::DevicePolicy::default(),
|
||||
metal2vulkan::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.map_err(|error| format!("its own description derives no profile: {error}"))?;
|
||||
let profile = device.device().profile();
|
||||
@@ -204,8 +204,8 @@ pub(super) fn attempt(
|
||||
}
|
||||
|
||||
/// The `Device` the context `device_type` opens: its queried description restricted to what it
|
||||
/// enabled, under the default policy ([`opened_device`]). What a device test compiles for, so its
|
||||
/// profile is the opened device's, never a committed one.
|
||||
/// enabled, under the resident-table domains ([`opened_device`]). What a device test compiles for,
|
||||
/// so its profile is the opened device's, never a committed one.
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
pub fn opened_worker_device(device_type: DeviceType) -> Result<WorkerDevice, ExecutorError> {
|
||||
with_validated_context(device_type, |context| Ok(opened_device(context)))
|
||||
@@ -213,14 +213,19 @@ pub fn opened_worker_device(device_type: DeviceType) -> Result<WorkerDevice, Exe
|
||||
}
|
||||
|
||||
/// The `Device` of the opened context: its queried description restricted to what the context
|
||||
/// enabled (`DeviceDescription::with_enabled`), under the default policy.
|
||||
/// enabled (`DeviceDescription::with_enabled`), under the resident-table domains
|
||||
/// (`DevicePolicy::RESIDENT_TABLES`): this executor builds the resident root and the handle table
|
||||
/// itself.
|
||||
pub(super) fn opened_device(context: &VulkanContext) -> Result<WorkerDevice, ExecutorError> {
|
||||
let description = context
|
||||
.opened_description
|
||||
.clone()
|
||||
.map_err(ExecutorError::Failed)?;
|
||||
WorkerDevice::new(description, metal2vulkan::device::DevicePolicy::default())
|
||||
.map_err(|e| product_refusal(&e))
|
||||
WorkerDevice::new(
|
||||
description,
|
||||
metal2vulkan::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.map_err(|e| product_refusal(&e))
|
||||
}
|
||||
|
||||
fn run(
|
||||
|
||||
@@ -51,7 +51,7 @@ impl TierProfile {
|
||||
}
|
||||
|
||||
/// A tier-table entry: a committed profile in one leg, and the profile lowering compiles for (the
|
||||
/// default untrusted policy, as every engine census row).
|
||||
/// default policy, the runtime's, as every engine census row).
|
||||
pub struct CommittedProfile {
|
||||
pub tier: TierProfile,
|
||||
pub profile: DeviceProfile,
|
||||
@@ -262,7 +262,7 @@ pub fn compile_module(
|
||||
attributes: &attributes,
|
||||
resident_roots: function.reads_resident_roots(),
|
||||
handle_table: function.resolves_handles(),
|
||||
// Every committed profile's device takes the default domains (`committed_profiles`).
|
||||
// Every committed profile's device takes the default policy (`committed_profiles`).
|
||||
policy: DevicePolicy::default(),
|
||||
strategies: function.strategies(),
|
||||
};
|
||||
|
||||
@@ -985,13 +985,13 @@ pub fn committed_profiles() -> Result<Vec<String>, String> {
|
||||
Ok(stems)
|
||||
}
|
||||
|
||||
/// The committed profile `stem` derived under the default (untrusted) policy, the policy every
|
||||
/// The committed profile `stem` derived under the default policy (the runtime's), the policy every
|
||||
/// engine census row is recorded under.
|
||||
pub fn load_profile(stem: &str) -> Result<DeviceProfile, String> {
|
||||
Ok(load_device(stem)?.profile().clone())
|
||||
}
|
||||
|
||||
/// The engine's `Device` for committed profile `stem` under the default untrusted policy:
|
||||
/// The engine's `Device` for committed profile `stem` under the default policy (the runtime's):
|
||||
/// what the public compile API compiles against (its profile is [`load_profile`]'s).
|
||||
pub fn load_device(stem: &str) -> Result<metal2vulkan::device::Device, String> {
|
||||
metal2vulkan::device::Device::from_queries(load_description(stem)?, DevicePolicy::default())
|
||||
|
||||
@@ -742,7 +742,7 @@ fn thread_memory_is_contained_by_the_typed_arrays_check_only() {
|
||||
attributes: &BTreeMap::new(),
|
||||
resident_roots: true,
|
||||
handle_table: true,
|
||||
policy: DevicePolicy::default(),
|
||||
policy: DevicePolicy::RESIDENT_TABLES,
|
||||
strategies: &strategies,
|
||||
};
|
||||
let target = OutOfBoundsTarget {
|
||||
@@ -903,12 +903,12 @@ fn the_identity_domains_leave_a_loaded_pointer_unchecked_and_mask_a_resource_id(
|
||||
ReadRule::ResidentTexels
|
||||
);
|
||||
assert!(
|
||||
containment(&pointer, &module(DevicePolicy::default()), profile)
|
||||
containment(&pointer, &module(DevicePolicy::RESIDENT_TABLES), profile)
|
||||
.unwrap_err()
|
||||
.contains("no memory through a pointer loaded")
|
||||
);
|
||||
assert!(
|
||||
containment(&handles, &module(DevicePolicy::default()), profile)
|
||||
containment(&handles, &module(DevicePolicy::RESIDENT_TABLES), profile)
|
||||
.unwrap_err()
|
||||
.contains("resolves no handle")
|
||||
);
|
||||
@@ -954,7 +954,7 @@ fn a_draws_targets_are_contained_by_their_fetch() {
|
||||
attributes,
|
||||
resident_roots: false,
|
||||
handle_table: false,
|
||||
policy: DevicePolicy::default(),
|
||||
policy: DevicePolicy::RESIDENT_TABLES,
|
||||
strategies,
|
||||
};
|
||||
let target = OutOfBoundsTarget {
|
||||
|
||||
@@ -79,14 +79,15 @@ fn committed_device(stem: &str) -> Result<Device> {
|
||||
Ok(device)
|
||||
}
|
||||
|
||||
/// A buffer bound at `offset` in a `length`-byte allocation whose Metal `gpuAddress` is
|
||||
/// `0x1_0000`, without a Vulkan device address.
|
||||
/// A buffer bound at `offset` in a `length`-byte allocation whose Metal `gpuAddress` and Vulkan
|
||||
/// device address are both `0x1_0000`, as the runtime makes them: under the default policy, the
|
||||
/// identity domains, a buffer slot is reached at its device address.
|
||||
fn buffer(length: u64, offset: u64) -> BoundBuffer {
|
||||
BoundBuffer::Buffer {
|
||||
length,
|
||||
offset,
|
||||
gpu_address: 0x1_0000,
|
||||
device_address: None,
|
||||
device_address: Some(0x1_0000),
|
||||
attribute_stride: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1169,7 +1169,7 @@ fn a_queried_description_derives_a_device() {
|
||||
dev.v11_props.subgroup_supported_stages = avk::ShaderStageFlags::ALL;
|
||||
dev.v11_props.subgroup_supported_operations = avk::SubgroupFeatureFlags::from_raw(0xff);
|
||||
let desc = dev.query().unwrap();
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("queried description derives");
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("queried description derives");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -83,8 +83,8 @@ fn each_module_needs_what_its_docs_say() {
|
||||
assert!(!r.features.contains(&VkFeature::SampleRateShading), "{r:?}");
|
||||
}
|
||||
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the default policy, by
|
||||
/// file stem.
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the resident-table domains,
|
||||
/// by file stem.
|
||||
fn committed_devices() -> Vec<(String, Device)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let mut out = Vec::new();
|
||||
@@ -99,7 +99,7 @@ fn committed_devices() -> Vec<(String, Device)> {
|
||||
.unwrap_or_default();
|
||||
let text = std::fs::read_to_string(&path).expect("read");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let device = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let device = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
out.push((stem, device));
|
||||
}
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
|
||||
@@ -48,7 +48,7 @@ fn shape(ty: TextureType, pf: PixelFormat, samples: u32, usage: TextureUsage) ->
|
||||
|
||||
/// The committed `moltenvk-m3` profile.
|
||||
fn m3() -> DeviceProfile {
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::default())
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile")
|
||||
}
|
||||
|
||||
@@ -1179,7 +1179,7 @@ fn sampler_tables_admit_the_shapes_the_plan_s_checks_pass() {
|
||||
let floor = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[crate::device::requirements::VkFeature::SamplerAnisotropy],
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let placement = HeapPlacement::ResourceId;
|
||||
|
||||
@@ -18,7 +18,7 @@ fn committed_devices() -> Vec<(String, Device)> {
|
||||
let text = std::fs::read_to_string(&p).expect("profile is readable");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("profile parses");
|
||||
let device =
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device derives");
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device derives");
|
||||
(stem, device)
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -243,9 +243,11 @@ fn a_numeric_slot_binds_either_integer_type() {
|
||||
class: SlotClass::Texture,
|
||||
index: 1,
|
||||
};
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::default())
|
||||
.expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
"moltenvk-m3",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let slot = TextureSlot {
|
||||
access: TextureAccess::new(false, false, true),
|
||||
..slot_iface(TextureType::Type2D, SampledType::Uint)
|
||||
@@ -321,9 +323,11 @@ fn a_texture_held_for_copies_alone_is_refused_at_a_float_slot() {
|
||||
class: SlotClass::Texture,
|
||||
index: 0,
|
||||
};
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::default())
|
||||
.expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
"moltenvk-m3",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let plan = |pixel_format, access: TextureAccess, sampled_type, ty| {
|
||||
let slot = TextureSlot {
|
||||
access,
|
||||
@@ -630,7 +634,7 @@ fn runtime_sampler_values_are_checked_at_plan_time() {
|
||||
crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[crate::device::requirements::VkFeature::SamplerMirrorClampToEdge],
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile"),
|
||||
));
|
||||
@@ -939,9 +943,11 @@ fn bicubic_texels_follow_the_bound_format() {
|
||||
class: SlotClass::Texture,
|
||||
index: 0,
|
||||
};
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::default())
|
||||
.expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
"moltenvk-m3",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let t = slot_iface(TextureType::Type2D, SampledType::Float);
|
||||
let slots = BTreeMap::from([(texture, SlotInterface::Texture(t))]);
|
||||
let plan = |pf: Option<PixelFormat>| {
|
||||
@@ -1014,9 +1020,11 @@ fn sampler_state_follows_the_bound_sampler() {
|
||||
class: SlotClass::Sampler,
|
||||
index: 1,
|
||||
};
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", crate::device::DevicePolicy::default())
|
||||
.expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
"moltenvk-m3",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let slots = BTreeMap::from([(
|
||||
slot,
|
||||
SlotInterface::Sampler(SamplerSlot {
|
||||
@@ -1296,8 +1304,11 @@ fn an_a8_texture_buffer_without_a8_unorm_views_its_bytes_in_red() {
|
||||
let uniform_ty = vk::DescriptorType::UNIFORM_TEXEL_BUFFER;
|
||||
let storage_ty = vk::DescriptorType::STORAGE_TEXEL_BUFFER;
|
||||
for (profile, held) in [("lavapipe", true), ("moltenvk-m3", false)] {
|
||||
let p = crate::pipeline::testing::profile(profile, crate::device::DevicePolicy::default())
|
||||
.expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
profile,
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let a8 = PixelFormat::A8Unorm;
|
||||
assert_eq!(
|
||||
crate::metal::format::alpha_in_red(a8, &p),
|
||||
|
||||
@@ -82,7 +82,8 @@ fn a_large_buffer_needs_the_device_address_variant_on_profile_a_only() {
|
||||
let storage = BufferForm::Descriptor(DescriptorView::Storage);
|
||||
let mut seen = [false; 2];
|
||||
let mut profiles = committed_profiles().expect("profiles");
|
||||
let f = crate::pipeline::testing::device_f(Default::default()).expect("Profile F");
|
||||
let f = crate::pipeline::testing::device_f(crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("Profile F");
|
||||
profiles.push((
|
||||
crate::pipeline::testing::PROFILE_F.to_string(),
|
||||
f.profile().clone(),
|
||||
@@ -147,8 +148,11 @@ fn a_large_buffer_needs_the_device_address_variant_on_profile_a_only() {
|
||||
/// and the slots the pipeline was compiled keeping, so the variant's plan restates it.
|
||||
#[test]
|
||||
fn a_large_viewed_slot_asks_for_every_large_candidate_to_stay_storage() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("runtime-floor", Default::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile(
|
||||
"runtime-floor",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let max = u64::from(p.fields().limits.max_uniform_buffer_range);
|
||||
let big = BoundKind::Buffer {
|
||||
device_address: false,
|
||||
|
||||
@@ -53,13 +53,13 @@ fn devices() -> Vec<(String, Device)> {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
(
|
||||
stem,
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device"),
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device"),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
// Profile F, below the runtime's floor: the form of a device without device addresses.
|
||||
let f = crate::pipeline::testing::device_f(DevicePolicy::default()).expect("Profile F");
|
||||
let f = crate::pipeline::testing::device_f(DevicePolicy::RESIDENT_TABLES).expect("Profile F");
|
||||
out.push((crate::pipeline::testing::PROFILE_F.to_string(), f));
|
||||
out
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ fn devices() -> Vec<(String, Device)> {
|
||||
.into_owned();
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
(stem, dev)
|
||||
})
|
||||
.collect();
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
// Profile F, below the runtime's floor: the form of a device without device addresses.
|
||||
let f = crate::pipeline::testing::device_f(DevicePolicy::default()).expect("Profile F");
|
||||
let f = crate::pipeline::testing::device_f(DevicePolicy::RESIDENT_TABLES).expect("Profile F");
|
||||
out.push((crate::pipeline::testing::PROFILE_F.to_string(), f));
|
||||
out
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ fn the_merge_fragment_module_is_one_per_sample_count() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the default policy, by
|
||||
/// file stem.
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the resident-table domains,
|
||||
/// by file stem.
|
||||
fn committed_devices() -> Vec<(String, Device)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let mut out = Vec::new();
|
||||
@@ -84,7 +84,7 @@ fn committed_devices() -> Vec<(String, Device)> {
|
||||
.unwrap_or_default();
|
||||
let text = std::fs::read_to_string(&path).expect("read");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let device = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let device = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
out.push((stem, device));
|
||||
}
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
|
||||
@@ -48,8 +48,8 @@ fn each_module_needs_what_its_docs_say() {
|
||||
assert!(r.features.is_empty(), "{r:?}");
|
||||
}
|
||||
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the default policy, by
|
||||
/// file stem.
|
||||
/// Every committed device (`validation/profiles/*.json`), derived with the resident-table domains,
|
||||
/// by file stem.
|
||||
fn committed_devices() -> Vec<(String, Device)> {
|
||||
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../metal2vulkan-validation/profiles");
|
||||
let mut out = Vec::new();
|
||||
@@ -64,7 +64,7 @@ fn committed_devices() -> Vec<(String, Device)> {
|
||||
.unwrap_or_default();
|
||||
let text = std::fs::read_to_string(&path).expect("read");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let device = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let device = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
out.push((stem, device));
|
||||
}
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
|
||||
+3
-3
@@ -37,14 +37,14 @@ fn fixture(stem: &str) -> Option<Vec<u8>> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Committed profile `stem` as a device with the default policy.
|
||||
/// Committed profile `stem` as a device with the resident-table domains.
|
||||
fn device(stem: &str) -> Device {
|
||||
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../metal2vulkan-validation/profiles")
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// `store_const` compiled on `dev`, with its compute pipeline.
|
||||
@@ -1374,7 +1374,7 @@ fn the_storage_view_variant_round_trips() {
|
||||
use crate::cache::VariantKey;
|
||||
use crate::pipeline::facts::{RuntimeFact, UniformViewChoice};
|
||||
// Profile F's descriptor buffers: four storage buffers a stage, below the runtime's floor.
|
||||
let dev = crate::pipeline::testing::device_f(DevicePolicy::default()).expect("device");
|
||||
let dev = crate::pipeline::testing::device_f(DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let Some(bc) = fixture("descriptor_limit_uniform_views") else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//!
|
||||
//! [`Device::from_queries`] derives an opaque [`DeviceProfile`] from the description's Vulkan
|
||||
//! queries and a [`DevicePolicy`], the consumer's product choices (the pointer and handle
|
||||
//! domains; the default is [`DevicePolicy::UNTRUSTED`]); no
|
||||
//! domains; the default is the runtime's, the identity domains); no
|
||||
//! driver or GPU identity decides anything, and no `VkDevice` is needed. It refuses a device below Vulkan
|
||||
//! 1.2 and an inconsistent description or policy. A [`Device`] is cheap to clone, and every
|
||||
//! compile and plan takes one:
|
||||
|
||||
@@ -5,28 +5,41 @@ use crate::device::profile::{HandleDomain, PointerDomain};
|
||||
|
||||
/// Policy inputs of `Device::from_queries`. Every field can change emitted code, so the profile
|
||||
/// carries it and its fingerprint covers it.
|
||||
///
|
||||
/// [`DevicePolicy::default`] is the one constructor: the runtime compiles under it, and the
|
||||
/// command line, the compile worker and every validation tool take their policy from it, so a
|
||||
/// tool compiles what the runtime does. [`DevicePolicy::RESIDENT_TABLES`] is the validation
|
||||
/// executor's alone.
|
||||
#[non_exhaustive]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct DevicePolicy {
|
||||
/// How pointer values resolve to resources: `ResidentTable`, or `Identity` with
|
||||
/// `handle_domain` `Identity`.
|
||||
/// How pointer values resolve to resources: `Identity` with `handle_domain` `Identity` (the
|
||||
/// default), or `ResidentTable` with `Table` (the validation executor's).
|
||||
pub pointer_domain: PointerDomain,
|
||||
/// How resource handles resolve: `Table`, or `Identity` with `pointer_domain` `Identity`.
|
||||
/// How resource handles resolve: `Identity` with `pointer_domain` `Identity` (the default), or
|
||||
/// `Table` with `ResidentTable` (the validation executor's).
|
||||
pub handle_domain: HandleDomain,
|
||||
}
|
||||
|
||||
impl DevicePolicy {
|
||||
/// The default domains: a resident table of pointers and a handle table.
|
||||
pub const UNTRUSTED: DevicePolicy = DevicePolicy {
|
||||
/// A resident table of pointers and a handle table, for the validation executor alone, which
|
||||
/// builds the resident root and the handle table itself.
|
||||
pub const RESIDENT_TABLES: DevicePolicy = DevicePolicy {
|
||||
pointer_domain: PointerDomain::ResidentTable,
|
||||
handle_domain: HandleDomain::Table,
|
||||
};
|
||||
}
|
||||
|
||||
impl Default for DevicePolicy {
|
||||
/// [`DevicePolicy::UNTRUSTED`].
|
||||
/// The identity domains, the runtime's: a pointer is the device address it holds and a
|
||||
/// texture's or sampler's handle is its `gpuResourceID` ([`PointerDomain::Identity`],
|
||||
/// [`HandleDomain::Identity`]). `Device::from_queries` refuses them on a device without
|
||||
/// `bufferDeviceAddress` and `shaderInt64` (`Feature::IdentityDomains`).
|
||||
fn default() -> DevicePolicy {
|
||||
DevicePolicy::UNTRUSTED
|
||||
DevicePolicy {
|
||||
pointer_domain: PointerDomain::Identity,
|
||||
handle_domain: HandleDomain::Identity,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -445,11 +445,14 @@ pub enum BufferAccess {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum PointerDomain {
|
||||
/// The sorted resident set of bound arguments and used resources.
|
||||
/// The sorted resident set of bound arguments and used resources. It exists for the
|
||||
/// validation executor only
|
||||
/// ([`DevicePolicy::RESIDENT_TABLES`](crate::device::DevicePolicy::RESIDENT_TABLES)), which
|
||||
/// builds the resident root itself.
|
||||
ResidentTable,
|
||||
/// Pointers are device addresses used directly: a `device` or `constant` pointer is the
|
||||
/// 64-bit Vulkan device address of the byte it names, as Metal's `gpuAddress` is, and a
|
||||
/// buffer slot is reached at its own address, pushed, uncontained, and a pointer loaded from
|
||||
/// buffer slot is reached at its own address, pushed, and a pointer loaded from
|
||||
/// memory or made from an integer is the address it holds, used directly. Needs
|
||||
/// `bufferDeviceAddress` and `shaderInt64`. So far it lowers a kernel that reaches memory
|
||||
/// only through its buffer slots and such addresses, and, on `Device::from_queries`' profile,
|
||||
@@ -464,12 +467,14 @@ pub enum PointerDomain {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum HandleDomain {
|
||||
/// The handle table plus the set-1 heap.
|
||||
/// The handle table plus the set-1 heap. It exists for the validation executor only
|
||||
/// ([`DevicePolicy::RESIDENT_TABLES`](crate::device::DevicePolicy::RESIDENT_TABLES)), which
|
||||
/// builds the handle table itself.
|
||||
Table,
|
||||
/// A texture's or sampler's handle is its `gpuResourceID`: the low 32 bits index the
|
||||
/// pipeline's descriptor arrays and the high 32 bits are the word of its Metal descriptor
|
||||
/// (`docs/RESOURCE-ID.md`). No function that reads a texture or a sampler compiles under it
|
||||
/// yet: it is refused as [`Feature::IdentityDomains`](crate::error::Feature::IdentityDomains).
|
||||
/// (`docs/RESOURCE-ID.md`). A texture or sampler use with no form under it is refused as
|
||||
/// [`Feature::IdentityDomains`](crate::error::Feature::IdentityDomains).
|
||||
Identity,
|
||||
}
|
||||
|
||||
|
||||
@@ -202,8 +202,8 @@ fn rgba4_opaque_black_swizzled_follows_exposure() {
|
||||
assert!(d.rgba4_opaque_black_swizzled);
|
||||
// The push window the floor needs, which a Vulkan 1.2 document leaves at 128.
|
||||
d.limits.max_push_constants_size = 256;
|
||||
let dev =
|
||||
crate::device::Device::from_queries(d, crate::device::DevicePolicy::default()).unwrap();
|
||||
let dev = crate::device::Device::from_queries(d, crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap();
|
||||
assert!(dev
|
||||
.profile()
|
||||
.fields()
|
||||
@@ -242,8 +242,8 @@ fn the_arm_spelling_of_rasterization_order_access_is_the_ext_one() {
|
||||
assert!(d.has(VkFeature::RasterizationOrderColorAttachmentAccess));
|
||||
// The push window the floor needs, which a Vulkan 1.2 document leaves at 128.
|
||||
d.limits.max_push_constants_size = 256;
|
||||
let dev =
|
||||
crate::device::Device::from_queries(d, crate::device::DevicePolicy::default()).unwrap();
|
||||
let dev = crate::device::Device::from_queries(d, crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap();
|
||||
assert!(
|
||||
dev.profile()
|
||||
.fields()
|
||||
@@ -812,7 +812,7 @@ fn descriptions_and_policies_round_trip_through_serde() {
|
||||
pointer_domain: crate::device::PointerDomain::Identity,
|
||||
handle_domain: crate::device::HandleDomain::Identity,
|
||||
};
|
||||
let policies = [DevicePolicy::default(), identity];
|
||||
let policies = [DevicePolicy::RESIDENT_TABLES, identity];
|
||||
for (stem, text) in committed_profiles() {
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let json = serde_json::to_string(&description).unwrap();
|
||||
|
||||
@@ -103,10 +103,10 @@ fn recommendations_are_closed_fixed_points_on_every_committed_profile() {
|
||||
.clone()
|
||||
.with_enabled(&rec)
|
||||
.unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let dev = Device::from_queries(restricted, DevicePolicy::default())
|
||||
let dev = Device::from_queries(restricted, DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
assert_eq!(dev.required_enables(), rec, "{stem}");
|
||||
let full = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let full = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(full.required_enables(), rec, "{stem}");
|
||||
assert_eq!(
|
||||
rec.extensions.contains(&VkExtension::KhrPortabilitySubset),
|
||||
@@ -147,9 +147,9 @@ fn recommendations_keep_robust_buffer_access_and_vuid_10247() {
|
||||
assert_eq!(rec.features.contains(f), reported, "{reported}: {f:?}");
|
||||
}
|
||||
let restricted = d.clone().with_enabled(&rec).unwrap();
|
||||
let dev = Device::from_queries(restricted, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(restricted, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(dev.required_enables(), rec, "{reported}");
|
||||
let whole = Device::from_queries(d.clone(), DevicePolicy::default()).unwrap();
|
||||
let whole = Device::from_queries(d.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(whole.required_enables(), rec, "{reported}");
|
||||
}
|
||||
}
|
||||
@@ -177,13 +177,13 @@ fn a_recommendation_keeps_vuid_10247() {
|
||||
.features
|
||||
.contains(&VkFeature::DescriptorBindingSampledImageUpdateAfterBind));
|
||||
let restricted = desc.clone().with_enabled(&rec).unwrap();
|
||||
let stated = Device::from_queries(restricted.clone(), DevicePolicy::default()).unwrap();
|
||||
let stated = Device::from_queries(restricted.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(stated.required_enables(), rec);
|
||||
let mut with_buffers = restricted;
|
||||
with_buffers
|
||||
.features
|
||||
.extend(BUFFER_UPDATE_AFTER_BIND.iter().copied());
|
||||
let both = Device::from_queries(with_buffers, DevicePolicy::default()).unwrap();
|
||||
let both = Device::from_queries(with_buffers, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(both.required_enables(), rec);
|
||||
let mut fields = both.profile().fields().clone();
|
||||
assert!(fields.descriptors.update_after_bind_storage_buffer);
|
||||
@@ -286,7 +286,7 @@ fn extended_dynamic_state2_is_enabled_below_1_3_and_implied_from_it() {
|
||||
}
|
||||
let dev = Device::from_queries(
|
||||
d.clone().with_enabled(&rec).unwrap(),
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.unwrap();
|
||||
let enabled = &dev.profile().fields().enabled;
|
||||
@@ -449,13 +449,13 @@ fn device_new_refuses_a_feature_without_its_companion() {
|
||||
}
|
||||
let mut d = floor_with(&[VkExtension::ExtRobustness2], &[f]);
|
||||
d.features.remove(&needs);
|
||||
let e = match Device::from_queries(d.clone(), DevicePolicy::default()) {
|
||||
let e = match Device::from_queries(d.clone(), DevicePolicy::RESIDENT_TABLES) {
|
||||
Err(Error::InvalidDescriptor(DescriptorError::DeviceDescription { detail })) => detail,
|
||||
other => panic!("{other:?}"),
|
||||
};
|
||||
assert!(e.contains(vuid), "{e}");
|
||||
d.features.insert(needs);
|
||||
Device::from_queries(d, DevicePolicy::default()).unwrap();
|
||||
Device::from_queries(d, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ fn required_enables_follow_version_dependencies_formats_and_flags() {
|
||||
fn device_new_refuses_unexposed_features() {
|
||||
let mut d = profile("runtime-floor");
|
||||
d.features.insert(VkFeature::Maintenance8);
|
||||
let e = match Device::from_queries(d.clone(), DevicePolicy::default()) {
|
||||
let e = match Device::from_queries(d.clone(), DevicePolicy::RESIDENT_TABLES) {
|
||||
Err(Error::InvalidDescriptor(DescriptorError::DeviceDescription { detail })) => detail,
|
||||
other => panic!("{other:?}"),
|
||||
};
|
||||
@@ -694,7 +694,7 @@ fn device_new_refuses_unexposed_features() {
|
||||
"{e}"
|
||||
);
|
||||
d.extensions.insert(VkExtension::KhrMaintenance8);
|
||||
Device::from_queries(d, DevicePolicy::default()).unwrap();
|
||||
Device::from_queries(d, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
}
|
||||
|
||||
/// The profile's format tables hold only formats the description exposes: a queried description
|
||||
@@ -735,7 +735,7 @@ fn profile_format_tables_hold_only_exposed_formats() {
|
||||
let entry = d.formats.formats[&vk::Format::R8_UNORM];
|
||||
d.formats.formats.insert(vk::Format::A8_UNORM, entry);
|
||||
let a8 = |d: &DeviceDescription| {
|
||||
Device::from_queries(d.clone(), DevicePolicy::default())
|
||||
Device::from_queries(d.clone(), DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap()
|
||||
.profile()
|
||||
.supports_format(vk::Format::A8_UNORM, FormatUsage::SampledImage)
|
||||
@@ -764,7 +764,7 @@ fn a_storage_read_without_a_format_is_enabled_by_the_feature_the_version_or_the_
|
||||
reads.spirv_capabilities.insert(SpirvCapability::of(
|
||||
crate::spv::Capability::StorageImageReadWithoutFormat,
|
||||
));
|
||||
let policy = DevicePolicy::default();
|
||||
let policy = DevicePolicy::RESIDENT_TABLES;
|
||||
let open = |desc: &DeviceDescription| {
|
||||
let enabled = desc.recommended_enables();
|
||||
let opened = desc.clone().with_enabled(&enabled).unwrap();
|
||||
|
||||
@@ -52,7 +52,7 @@ fn from_queries_derives_one_profile_whatever_the_identity() {
|
||||
other.vendor_id = vendor;
|
||||
other.device_id = device;
|
||||
other.device_type = Some(kind);
|
||||
Device::from_queries(other, DevicePolicy::default())
|
||||
Device::from_queries(other, DevicePolicy::RESIDENT_TABLES)
|
||||
.ok()
|
||||
.map(|d| d.profile().clone())
|
||||
})
|
||||
@@ -154,7 +154,7 @@ fn a_push_window_below_256_bytes_is_below_the_floor() {
|
||||
for stem in &below {
|
||||
let text = std::fs::read_to_string(dir.join(format!("{stem}.json"))).expect("readable");
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect("parses");
|
||||
match Device::from_queries(description, DevicePolicy::default()) {
|
||||
match Device::from_queries(description, DevicePolicy::RESIDENT_TABLES) {
|
||||
Err(Error::Unsupported(u)) => {
|
||||
assert_eq!(u.feature, Feature::PushWindow, "{stem}");
|
||||
let limit = Capability::Limit {
|
||||
@@ -168,7 +168,7 @@ fn a_push_window_below_256_bytes_is_below_the_floor() {
|
||||
}
|
||||
}
|
||||
for (stem, _) in committed_profiles() {
|
||||
if let Err(e) = Device::from_queries(profile(&stem), DevicePolicy::default()) {
|
||||
if let Err(e) = Device::from_queries(profile(&stem), DevicePolicy::RESIDENT_TABLES) {
|
||||
panic!("{stem} is committed but below the floor: {e}");
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ fn from_queries_records_the_device_denormals_of_a_float_product() {
|
||||
};
|
||||
let mut compiled = 0;
|
||||
for (stem, _) in committed_profiles() {
|
||||
let Ok(device) = Device::from_queries(profile(&stem), DevicePolicy::default()) else {
|
||||
let Ok(device) = Device::from_queries(profile(&stem), DevicePolicy::RESIDENT_TABLES) else {
|
||||
continue;
|
||||
};
|
||||
let a = compile(&bc, "mixed_products", device.profile())
|
||||
@@ -253,7 +253,7 @@ fn from_queries_clears_a_narrow_value_by_an_and_on_ga10x() {
|
||||
.count();
|
||||
(ands, extracts)
|
||||
};
|
||||
let queried = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let queried = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let (ands, extracts) = counts(queried.profile());
|
||||
assert!(ands > 0, "from_queries: no AND");
|
||||
assert_eq!(extracts, 0, "from_queries: an extract");
|
||||
|
||||
@@ -553,7 +553,8 @@ fn profile_dependent_rows_differ_where_the_design_says() {
|
||||
below.features.remove(&f);
|
||||
}
|
||||
let floor =
|
||||
crate::device::Device::from_queries(below, crate::device::DevicePolicy::default()).unwrap();
|
||||
crate::device::Device::from_queries(below, crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap();
|
||||
let addressed = device("nvidia-rtx50-linux");
|
||||
assert_eq!(mechanism(&range, floor.profile()), Mechanism::PlanTimeCheck);
|
||||
assert_eq!(mechanism(&range, addressed.profile()), Mechanism::Variant);
|
||||
|
||||
@@ -6,19 +6,20 @@ use crate::device::requirements::{Requirements, StageCreateFlag, VkLimit, VkProp
|
||||
use crate::error::{Capability, Feature, Needs};
|
||||
|
||||
pub(crate) fn device(stem: &str) -> Device {
|
||||
Device::from_queries(profile(stem), DevicePolicy::default()).expect("committed profile derives")
|
||||
Device::from_queries(profile(stem), DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("committed profile derives")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_committed_profile_derives() {
|
||||
for (stem, text) in committed_profiles() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default())
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let f = dev.profile().fields();
|
||||
assert_eq!(f.api_version, desc.api_version, "{stem}");
|
||||
// Deterministic.
|
||||
let again = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let again = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(dev.profile(), again.profile(), "{stem}");
|
||||
assert_eq!(dev.profile().fingerprint(), again.profile().fingerprint());
|
||||
// A profile satisfies the requirements of everything it enabled.
|
||||
@@ -56,7 +57,7 @@ fn occlusion_query_precise_follows_each_source() {
|
||||
stated,
|
||||
"{stem}"
|
||||
);
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let enabled = &dev.profile().fields().enabled.features;
|
||||
assert_eq!(
|
||||
enabled.contains(&VkFeature::OcclusionQueryPrecise),
|
||||
@@ -89,7 +90,7 @@ fn depth_bias_control_follows_each_source() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let has_extension = desc.extensions.contains(&VkExtension::ExtDepthBiasControl);
|
||||
assert_eq!(has_extension, stated.is_some(), "{stem}");
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let enabled = &dev.profile().fields().enabled;
|
||||
for (member, feature) in features {
|
||||
let want = stated
|
||||
@@ -146,7 +147,8 @@ fn memory_profiles_follow_bda_and_int64() {
|
||||
&[VkFeature::BufferDeviceAddress, VkFeature::ShaderInt64][..],
|
||||
&[VkFeature::ShaderInt64],
|
||||
] {
|
||||
let dev = Device::from_queries(floor_without(without), DevicePolicy::default()).unwrap();
|
||||
let dev =
|
||||
Device::from_queries(floor_without(without), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
dev.profile().fields().buffer_access,
|
||||
BufferAccess::Floor,
|
||||
@@ -177,7 +179,7 @@ fn addressed_needs_name_only_the_missing_features() {
|
||||
let bda = Capability::Feature(VkFeature::BufferDeviceAddress);
|
||||
let int64 = Capability::Feature(VkFeature::ShaderInt64);
|
||||
let needs = |without: &[VkFeature]| {
|
||||
Device::from_queries(floor_without(without), DevicePolicy::default())
|
||||
Device::from_queries(floor_without(without), DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap()
|
||||
.profile()
|
||||
.addressed_needs()
|
||||
@@ -243,12 +245,12 @@ fn vertex_layer_and_viewport_outputs_follow_the_features_not_the_extension() {
|
||||
assert!(desc
|
||||
.extensions
|
||||
.contains(&VkExtension::ExtShaderViewportIndexLayer));
|
||||
let full = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let full = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let f = full.profile().fields();
|
||||
assert!(f.fragment.output_layer && f.fragment.output_viewport_index);
|
||||
assert!(desc.features.remove(&VkFeature::ShaderOutputLayer));
|
||||
assert!(desc.features.remove(&VkFeature::ShaderOutputViewportIndex));
|
||||
let lacking = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let lacking = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let f = lacking.profile().fields();
|
||||
assert!(!f.fragment.output_layer);
|
||||
assert!(!f.fragment.output_viewport_index);
|
||||
@@ -281,7 +283,7 @@ fn robustness2_selects_the_rba2_encoding() {
|
||||
fn below_1_2_is_refused() {
|
||||
let mut desc = profile("runtime-floor");
|
||||
desc.api_version = ApiVersion { major: 1, minor: 1 };
|
||||
match Device::from_queries(desc, DevicePolicy::default()) {
|
||||
match Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES) {
|
||||
Err(Error::Unsupported(u)) => {
|
||||
assert_eq!(u.feature, Feature::VulkanVersion);
|
||||
assert_eq!(
|
||||
@@ -301,16 +303,16 @@ fn the_identity_domains_come_as_a_pair_on_a_device_with_addresses() {
|
||||
let identity = DevicePolicy {
|
||||
pointer_domain: PointerDomain::Identity,
|
||||
handle_domain: HandleDomain::Identity,
|
||||
..DevicePolicy::default()
|
||||
..DevicePolicy::RESIDENT_TABLES
|
||||
};
|
||||
for half in [
|
||||
DevicePolicy {
|
||||
pointer_domain: PointerDomain::Identity,
|
||||
..DevicePolicy::default()
|
||||
..DevicePolicy::RESIDENT_TABLES
|
||||
},
|
||||
DevicePolicy {
|
||||
handle_domain: HandleDomain::Identity,
|
||||
..DevicePolicy::default()
|
||||
..DevicePolicy::RESIDENT_TABLES
|
||||
},
|
||||
] {
|
||||
assert!(
|
||||
@@ -338,7 +340,7 @@ fn the_identity_domains_come_as_a_pair_on_a_device_with_addresses() {
|
||||
#[test]
|
||||
fn fingerprint_covers_every_policy_field() {
|
||||
let desc = profile("lavapipe");
|
||||
let base = DevicePolicy::default();
|
||||
let base = DevicePolicy::RESIDENT_TABLES;
|
||||
let fp = |p: DevicePolicy| {
|
||||
Device::from_queries(desc.clone(), p)
|
||||
.unwrap()
|
||||
@@ -455,7 +457,7 @@ fn allocation_sizes_are_no_profile_field() {
|
||||
] {
|
||||
let mut other = desc.clone();
|
||||
other.allocation = AllocationLimits::new(memory, buffer);
|
||||
let dev = Device::from_queries(other, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(other, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(dev.profile(), base.profile(), "{stem}");
|
||||
assert_eq!(
|
||||
dev.profile().fingerprint(),
|
||||
@@ -563,7 +565,7 @@ fn check_reports_the_first_missing_capability() {
|
||||
// `computeFullSubgroups`, a device below it, names it.
|
||||
let without = Device::from_queries(
|
||||
floor_without(&[VkFeature::ComputeFullSubgroups]),
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@@ -647,14 +649,14 @@ fn storage_without_format_follows_each_format() {
|
||||
U::StorageTexelBufferReadWithoutFormat,
|
||||
U::StorageTexelBufferWriteWithoutFormat,
|
||||
];
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(usages(&dev, vk::Format::R32_UINT), all);
|
||||
assert_eq!(usages(&dev, vk::Format::B8G8R8A8_UNORM), []);
|
||||
let mut write_only = desc.clone();
|
||||
write_only
|
||||
.features
|
||||
.remove(&VkFeature::ShaderStorageImageReadWithoutFormat);
|
||||
let dev = Device::from_queries(write_only, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(write_only, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
usages(&dev, vk::Format::R32_UINT),
|
||||
[
|
||||
@@ -667,7 +669,7 @@ fn storage_without_format_follows_each_format() {
|
||||
// extension at 1.2 reports them as Vulkan 1.3 does.
|
||||
desc.khr_format_feature_flags2 = true;
|
||||
assert!(desc.has_format_feature_flags2());
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
usages(&dev, vk::Format::R32_UINT),
|
||||
[
|
||||
@@ -683,7 +685,7 @@ fn storage_without_format_follows_each_format() {
|
||||
F::STORAGE_READ_WITHOUT_FORMAT,
|
||||
),
|
||||
);
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
usages(&dev, vk::Format::B8G8R8A8_UNORM),
|
||||
[
|
||||
@@ -694,7 +696,7 @@ fn storage_without_format_follows_each_format() {
|
||||
// The implication needs the feature.
|
||||
desc.features
|
||||
.remove(&VkFeature::ShaderStorageImageReadWithoutFormat);
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
usages(&dev, vk::Format::R32_UINT),
|
||||
[U::StorageImageWriteWithoutFormat]
|
||||
@@ -751,7 +753,7 @@ fn from_queries_half_rounding_follows_the_queries_alone() {
|
||||
let mut controlled = Vec::new();
|
||||
for (stem, text) in committed_profiles() {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let device = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let device = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let p = device.profile();
|
||||
if half_controls(p) {
|
||||
assert_eq!(quantize_form(p), QuantizeForm::Controlled, "{stem}");
|
||||
|
||||
@@ -145,7 +145,7 @@ fn render_features_follow_each_source() {
|
||||
for (stem, text) in committed_profiles() {
|
||||
let json: Value = serde_json::from_str(&text).unwrap();
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let enabled = &dev.profile().fields().enabled;
|
||||
for (structure, member, feature, extension) in FEATURES {
|
||||
let exposed = extension.is_none_or(|e| desc.extensions.contains(&e));
|
||||
@@ -216,7 +216,7 @@ fn render_properties_and_limits_follow_each_source() {
|
||||
for (stem, text) in committed_profiles() {
|
||||
let json: Value = serde_json::from_str(&text).unwrap();
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let properties = &dev.profile().fields().enabled.properties;
|
||||
let depth = stated_flags(&json, "supportedDepthResolveModes");
|
||||
let stencil = stated_flags(&json, "supportedStencilResolveModes");
|
||||
@@ -299,7 +299,7 @@ fn each_stated_color_attachment_sample_count_derives_its_property() {
|
||||
for (stem, text) in committed_profiles() {
|
||||
let json: Value = serde_json::from_str(&text).unwrap();
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let derived: BTreeSet<(vk::Format, u32)> = dev
|
||||
.profile()
|
||||
.fields()
|
||||
@@ -379,7 +379,7 @@ fn the_provoking_vertex_mode_per_pipeline_follows_each_source() {
|
||||
for (stem, text) in committed_profiles() {
|
||||
let json: Value = serde_json::from_str(&text).unwrap();
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let properties = &dev.profile().fields().enabled.properties;
|
||||
let exposed = desc.extensions.contains(&VkExtension::ExtProvokingVertex);
|
||||
let stated = stated_true(
|
||||
|
||||
@@ -778,7 +778,7 @@ fn builtin_facts_and_projections() {
|
||||
#[test]
|
||||
fn derivation_modules_are_valid() {
|
||||
for stem in ["moltenvk-m3", "runtime-floor"] {
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect(stem);
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES).expect(stem);
|
||||
for form in [LocalSizeForm::Spec, LocalSizeForm::Flat] {
|
||||
for mr in [false, true] {
|
||||
assert_valid(module(&plan(form, mr)), &p);
|
||||
@@ -899,7 +899,7 @@ fn the_flat_variant_s_64_bit_division_is_exact() {
|
||||
)
|
||||
.expect("entry");
|
||||
let m = mb.finalize().expect("finalize");
|
||||
let p = crate::pipeline::testing::profile("intel-arl-anv", DevicePolicy::default())
|
||||
let p = crate::pipeline::testing::profile("intel-arl-anv", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
assert_valid(m.clone(), &p);
|
||||
let bytes: Vec<u8> = cases
|
||||
|
||||
@@ -16,7 +16,7 @@ fn profile(stem: &str, features: &[VkFeature]) -> DeviceProfile {
|
||||
for f in features {
|
||||
desc.features.remove(f);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
@@ -31,7 +31,7 @@ fn profile_with(stem: &str, features: &[VkFeature], flags2: bool) -> DeviceProfi
|
||||
for f in features {
|
||||
desc.features.remove(f);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -15,7 +15,7 @@ fn profile(stem: &str, features: &[VkFeature]) -> DeviceProfile {
|
||||
for f in features {
|
||||
desc.features.remove(f);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -127,7 +127,7 @@ declare { <4 x float>, i8 } @air.sample_texture_2d_grad.v4f32(ptr addrspace(1),
|
||||
fn p(stem: &str) -> DeviceProfile {
|
||||
let mut desc = crate::pipeline::testing::description(stem).expect(stem);
|
||||
desc.features.remove(&VkFeature::SamplerAnisotropy);
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect(stem)
|
||||
.profile()
|
||||
.clone()
|
||||
@@ -136,7 +136,7 @@ fn p(stem: &str) -> DeviceProfile {
|
||||
/// Committed profile `stem` as described, `samplerAnisotropy` included: the device's own
|
||||
/// anisotropic filter.
|
||||
fn full(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect(stem)
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect(stem)
|
||||
}
|
||||
|
||||
fn ok(bc: &[u8], entry: &str, p: &DeviceProfile) -> std::sync::Arc<FunctionArtifact> {
|
||||
@@ -344,7 +344,7 @@ fn a_bound_anisotropic_sampler_asks_for_the_variant() {
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
assert!(desc.features.remove(&VkFeature::SamplerAnisotropy));
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let pipeline = |inputs: &LoweringInputs| {
|
||||
let function = Library::from_air(&bc)
|
||||
.and_then(|lib| lib.function("k"))
|
||||
@@ -617,7 +617,7 @@ fn without_sampler_anisotropy_metals_filter_is_emulated() {
|
||||
let fact = RuntimeFact::AnisotropicSampler { slot: SLOT };
|
||||
for withheld in [false, true] {
|
||||
let what = format!("samplerAnisotropy withheld {withheld}");
|
||||
let p = anisotropy_of("lavapipe", DevicePolicy::default(), withheld);
|
||||
let p = anisotropy_of("lavapipe", DevicePolicy::RESIDENT_TABLES, withheld);
|
||||
let device = !withheld;
|
||||
let a = ok(&constexpr, "k", &p);
|
||||
assert_eq!(
|
||||
|
||||
@@ -314,7 +314,7 @@ mod tests {
|
||||
use crate::error::Needs;
|
||||
|
||||
fn profile(stem: &str) -> DeviceProfile {
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile")
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// The words of the public fixtures' constexpr samplers (bit 63 clear).
|
||||
|
||||
@@ -195,7 +195,11 @@ fn vulkan_model_profile() -> (String, DeviceProfile) {
|
||||
#[test]
|
||||
fn emitted_barriers_order_memory_and_validate() {
|
||||
let (stem, vk) = vulkan_model_profile();
|
||||
let glsl = crate::pipeline::testing::profile("moltenvk-m3", Default::default()).expect("m3");
|
||||
let glsl = crate::pipeline::testing::profile(
|
||||
"moltenvk-m3",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("m3");
|
||||
for model in [BarrierModel::Glsl450, BarrierModel::Vulkan] {
|
||||
for (scope, fence) in [
|
||||
(Scope::Workgroup, None),
|
||||
|
||||
@@ -14,9 +14,12 @@ fn profiles() -> Vec<(String, crate::device::profile::DeviceProfile)> {
|
||||
let mut out = committed_profiles().expect("profiles");
|
||||
let scope = VkFeature::VulkanMemoryModelDeviceScope;
|
||||
for without in [&[scope][..], &[VkFeature::VulkanMemoryModel, scope]] {
|
||||
let p =
|
||||
crate::pipeline::testing::profile_without("runtime-floor", without, Default::default())
|
||||
.expect("below the floor");
|
||||
let p = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
without,
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("below the floor");
|
||||
out.push((format!("runtime-floor without {without:?}"), p));
|
||||
}
|
||||
out
|
||||
|
||||
@@ -55,7 +55,8 @@ options:
|
||||
--device FILE the target device as a description and a policy: the JSON form of
|
||||
metal2vulkan::device::DeviceDescription and DevicePolicy,
|
||||
{"description": ..., "policy": ...}, in place of --profile (a
|
||||
runtime's compile device; --profile takes the default domains)
|
||||
runtime's compile device; --profile takes the runtime's policy,
|
||||
the identity domains)
|
||||
--function NAME the kernel or vertex function (default: the library's only one)
|
||||
--fragment NAME the fragment function of a render pipeline
|
||||
--constant ID:TYPE:VALUE function-constant value (repeatable): ID is an index or a name, TYPE a
|
||||
|
||||
@@ -21,12 +21,12 @@ use crate::pipeline::testing::{meter, profile};
|
||||
const AIR_DL: &str = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32";
|
||||
|
||||
fn addressed() -> DeviceProfile {
|
||||
profile("moltenvk-m3", DevicePolicy::default()).expect("moltenvk-m3")
|
||||
profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("moltenvk-m3")
|
||||
}
|
||||
|
||||
/// Profile F: a device without device addresses, below the runtime's floor.
|
||||
fn floor() -> DeviceProfile {
|
||||
let dev = crate::pipeline::testing::device_f(DevicePolicy::default()).expect("Profile F");
|
||||
let dev = crate::pipeline::testing::device_f(DevicePolicy::RESIDENT_TABLES).expect("Profile F");
|
||||
dev.profile().clone()
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ pub(crate) fn committed_devices() -> Vec<(String, Device)> {
|
||||
.into_iter()
|
||||
.map(|(stem, desc)| {
|
||||
let device =
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device derives");
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device derives");
|
||||
(stem, device)
|
||||
})
|
||||
.collect()
|
||||
@@ -49,7 +49,7 @@ fn floor_with(formats: &[(vk::Format, vk::FormatFeatureFlags)]) -> DeviceDescrip
|
||||
}
|
||||
|
||||
fn device(desc: DeviceDescription) -> Device {
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device derives")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device derives")
|
||||
}
|
||||
|
||||
fn usages(list: &[FormatUsage]) -> BTreeSet<FormatUsage> {
|
||||
|
||||
@@ -378,10 +378,10 @@ mod tests {
|
||||
use crate::pipeline::testing::profile;
|
||||
let nvidia = profile(
|
||||
"nvidia-rtx5080-laptop",
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.unwrap();
|
||||
let lavapipe = profile("lavapipe", crate::device::DevicePolicy::default()).unwrap();
|
||||
let lavapipe = profile("lavapipe", crate::device::DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
for pf in [
|
||||
PixelFormat::A1BGR5Unorm,
|
||||
PixelFormat::ABGR4Unorm,
|
||||
@@ -407,7 +407,11 @@ mod tests {
|
||||
WordAttachment::of(PixelFormat::RGB9E5Float, &nvidia),
|
||||
Some(WordAttachment::Rgb9e5)
|
||||
);
|
||||
let radv = profile("amd-rdna3-radv", crate::device::DevicePolicy::default()).unwrap();
|
||||
let radv = profile(
|
||||
"amd-rdna3-radv",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(WordAttachment::of(PixelFormat::RGB9E5Float, &radv), None);
|
||||
// Vulkan makes `R5G6B5` and `A1R5G5B5` attachments mandatory.
|
||||
for pf in [PixelFormat::B5G6R5Unorm, PixelFormat::BGR5A1Unorm] {
|
||||
|
||||
@@ -1345,7 +1345,7 @@ mod tests {
|
||||
desc.features.remove(f);
|
||||
}
|
||||
desc.limits.max_sampler_anisotropy_bits = 16f32.to_bits();
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
}
|
||||
|
||||
/// What a plan reads of a bound sampler's shape to check its separate textures' views
|
||||
@@ -1439,7 +1439,7 @@ mod tests {
|
||||
];
|
||||
let (mut checked, mut past_limit, mut withheld) = (0, 0, 0);
|
||||
for (stem, description) in committed_descriptions() {
|
||||
let dev = Device::from_queries(description, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let p = dev.profile();
|
||||
let limit = f32::from_bits(p.fields().limits.max_sampler_lod_bias_bits);
|
||||
if p.fields()
|
||||
@@ -1519,7 +1519,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.1;
|
||||
floor.limits.max_sampler_lod_bias_bits = 15.5f32.to_bits();
|
||||
let floor = Device::from_queries(floor, DevicePolicy::default()).unwrap();
|
||||
let floor = Device::from_queries(floor, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let p = floor.profile();
|
||||
assert!(!(p.fields().enabled).portability_withholds(VkFeature::SamplerMipLodBias));
|
||||
let exact = |b: f32| match device_lod_bias(b, p) {
|
||||
@@ -1547,7 +1547,7 @@ mod tests {
|
||||
.map(|(stem, d)| {
|
||||
(
|
||||
stem,
|
||||
Device::from_queries(d, DevicePolicy::default()).unwrap(),
|
||||
Device::from_queries(d, DevicePolicy::RESIDENT_TABLES).unwrap(),
|
||||
)
|
||||
})
|
||||
.find(|(_, dev)| {
|
||||
@@ -1575,7 +1575,7 @@ mod tests {
|
||||
fn the_device_lod_bias_carries_its_note_where_it_is_not_the_bias() {
|
||||
let note = Some(PrecisionNote::CappedLodBias);
|
||||
for (stem, d) in committed_descriptions() {
|
||||
let dev = Device::from_queries(d, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(d, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let p = dev.profile();
|
||||
let withheld = (p.fields().enabled).portability_withholds(VkFeature::SamplerMipLodBias);
|
||||
let limit = f32::from_bits(p.fields().limits.max_sampler_lod_bias_bits).max(0.0);
|
||||
@@ -1714,11 +1714,11 @@ mod tests {
|
||||
let mvk = committed("moltenvk-m3");
|
||||
assert!(mvk.extensions.contains(&VkExtension::KhrPortabilitySubset));
|
||||
assert!(mvk.features.contains(&mutable));
|
||||
let dev = Device::from_queries(mvk.clone(), DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(mvk.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert!(vk_sampler(&d, compare, dev.profile()).is_ok());
|
||||
let mut withheld = mvk;
|
||||
withheld.features.remove(&mutable);
|
||||
let dev = Device::from_queries(withheld, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(withheld, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(
|
||||
vk_sampler(&d, compare, dev.profile()),
|
||||
Err(Unsupported::needs(Feature::SamplerCompare, Capability::Feature(mutable)).into())
|
||||
@@ -1726,7 +1726,7 @@ mod tests {
|
||||
assert!(vk_sampler(&d, SamplerUse::default(), dev.profile()).is_ok());
|
||||
let lavapipe = committed("lavapipe");
|
||||
assert!(!lavapipe.features.contains(&mutable));
|
||||
let dev = Device::from_queries(lavapipe, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(lavapipe, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert!(vk_sampler(&d, compare, dev.profile()).is_ok());
|
||||
}
|
||||
|
||||
@@ -1768,7 +1768,7 @@ mod tests {
|
||||
.unwrap();
|
||||
desc.features.insert(VkFeature::SamplerAnisotropy);
|
||||
desc.limits.max_sampler_anisotropy_bits = 16f32.to_bits();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
{
|
||||
for (min, mag) in [
|
||||
(Linear, Linear),
|
||||
@@ -1974,7 +1974,7 @@ mod tests {
|
||||
VkFeature::BorderColorSwizzle,
|
||||
VkFeature::BorderColorSwizzleFromImage,
|
||||
]);
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
};
|
||||
let mapping = |format, components, emulation| FormatMapping {
|
||||
format,
|
||||
@@ -2144,7 +2144,7 @@ mod tests {
|
||||
]);
|
||||
}
|
||||
desc.rgba4_opaque_black_swizzled = rgba4;
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
};
|
||||
let direct = FormatMapping {
|
||||
format: vk::Format::R4G4B4A4_UNORM_PACK16,
|
||||
@@ -2232,7 +2232,7 @@ mod tests {
|
||||
]);
|
||||
desc.features.extend(features.iter().copied());
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
};
|
||||
let plain = with(&[]);
|
||||
let swizzle_only = with(&[VkFeature::BorderColorSwizzle]);
|
||||
@@ -2654,7 +2654,7 @@ mod tests {
|
||||
let mut desc = desc;
|
||||
desc.features.insert(VkFeature::SamplerAnisotropy);
|
||||
desc.limits.max_sampler_anisotropy_bits = 16f32.to_bits();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
{
|
||||
let use_ = SamplerUse::new(false, false);
|
||||
let (linear, nearest) = device_anisotropy_by_filters(use_, dev.profile());
|
||||
|
||||
@@ -507,7 +507,7 @@ mod tests {
|
||||
} else {
|
||||
desc.features.remove(&VkFeature::DualSrcBlend);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
}
|
||||
|
||||
/// Every concrete factor maps, the names agree, and only `Source1*` needs `dualSrcBlend`.
|
||||
@@ -635,7 +635,7 @@ mod tests {
|
||||
for f in withheld {
|
||||
assert!(desc.features.remove(f), "{name} has {f:?}");
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default()).unwrap()
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap()
|
||||
}
|
||||
|
||||
/// The encoder's fill mode, depth clip mode, and depth bias clamp map where the device has
|
||||
|
||||
@@ -530,7 +530,7 @@ mod tests {
|
||||
);
|
||||
desc.features
|
||||
.remove(&VkFeature::VertexAttributeInstanceRateDivisor);
|
||||
let plain = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let plain = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
desc.features
|
||||
.insert(VkFeature::VertexAttributeInstanceRateDivisor);
|
||||
// Listed with the extension that exposes it below Vulkan 1.4.
|
||||
@@ -539,9 +539,9 @@ mod tests {
|
||||
desc.limits.max_vertex_attrib_divisor = 4;
|
||||
// No nonzero first instance with a divisor (VUID-vkCmdDraw-pNext-09461): pulled.
|
||||
desc.limits.supports_non_zero_first_instance = false;
|
||||
let zero_first = Device::from_queries(desc.clone(), DevicePolicy::default()).unwrap();
|
||||
let zero_first = Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
desc.limits.supports_non_zero_first_instance = true;
|
||||
let divisor = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let divisor = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
use VertexStepFunction as S;
|
||||
let fetch = |dev: &Device, f, s, r| attribute_fetch(f, s, r, dev.profile());
|
||||
let fixed = |rate, divisor| {
|
||||
@@ -619,7 +619,7 @@ mod tests {
|
||||
},
|
||||
);
|
||||
}
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert!(dev.profile().supports_format(
|
||||
vk::Format::E5B9G9R9_UFLOAT_PACK32,
|
||||
FormatUsage::VertexBuffer
|
||||
@@ -654,8 +654,8 @@ mod tests {
|
||||
let mut bare = robust.clone();
|
||||
bare.features.remove(&VkFeature::RobustBufferAccess);
|
||||
bare.features.remove(&VkFeature::RobustBufferAccess2);
|
||||
let checked = Device::from_queries(bare, DevicePolicy::default()).unwrap();
|
||||
let robust = Device::from_queries(robust, DevicePolicy::default()).unwrap();
|
||||
let checked = Device::from_queries(bare, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
let robust = Device::from_queries(robust, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
assert_eq!(contain::encoding(checked.profile()), Check::InShader);
|
||||
assert_eq!(contain::encoding(robust.profile()), Check::None);
|
||||
let float4 = VertexFormat::Float4;
|
||||
@@ -692,7 +692,7 @@ mod tests {
|
||||
{
|
||||
continue;
|
||||
}
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).unwrap();
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).unwrap();
|
||||
for v in [
|
||||
VertexFormat::Float,
|
||||
VertexFormat::Float2,
|
||||
|
||||
@@ -306,7 +306,7 @@ declare i32 @air.get_width_texture_2d(ptr addrspace(1), i32)
|
||||
0,
|
||||
FunctionConstantValue::new(DataType::Bool, [u8::from(on)]),
|
||||
);
|
||||
let p = profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("lavapipe", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let a = compile_bitcode(
|
||||
&bc,
|
||||
EntryRef::Name("k"),
|
||||
|
||||
@@ -302,7 +302,7 @@ entry:
|
||||
}
|
||||
|
||||
fn lavapipe() -> crate::device::DeviceProfile {
|
||||
profile("lavapipe", DevicePolicy::default()).expect("profile")
|
||||
profile("lavapipe", DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// **Making a kernel's bitcode leaves nothing under the OS temp directory.** The helper used
|
||||
|
||||
@@ -61,9 +61,9 @@ fn fixture(stem: &str) -> Option<Vec<u8>> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Committed profile `stem` as a device with the default policy.
|
||||
/// Committed profile `stem` as a device with the resident-table domains.
|
||||
fn device(stem: &str) -> Device {
|
||||
Device::from_queries(description(stem), DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(description(stem), DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Committed profile `stem` as the Khronos reader describes it.
|
||||
@@ -1616,7 +1616,8 @@ fn a_render_pipeline_requires_extended_dynamic_state_exactly_when_it_makes_one_d
|
||||
)));
|
||||
d.rasterization_enabled = false;
|
||||
let compile = |desc: &DeviceDescription| {
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).expect("device");
|
||||
let dev =
|
||||
Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let pipe = dev
|
||||
.compile_render_pipeline(&d, &Budget::standard())
|
||||
.expect("render pipeline");
|
||||
@@ -1714,7 +1715,8 @@ fn a_vertex_pipeline_makes_its_input_assembly_dynamic_exactly_with_both_extended
|
||||
)));
|
||||
d.rasterization_enabled = false;
|
||||
let compile = |desc: &DeviceDescription| {
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).expect("device");
|
||||
let dev =
|
||||
Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
dev.compile_render_pipeline(&d, &Budget::standard())
|
||||
.expect("render pipeline")
|
||||
};
|
||||
@@ -1849,7 +1851,7 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
let lavapipe = description("lavapipe");
|
||||
assert!(lavapipe.has(ORDERED));
|
||||
{
|
||||
let pipe = compile(&lavapipe, DevicePolicy::default(), &d).expect("lavapipe");
|
||||
let pipe = compile(&lavapipe, DevicePolicy::RESIDENT_TABLES, &d).expect("lavapipe");
|
||||
assert!(!unordered(&pipe));
|
||||
assert_eq!(pipe.graphics.input_attachments.len(), 1);
|
||||
assert!(pipe.graphics.storage_attachments.is_empty());
|
||||
@@ -1868,7 +1870,7 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
interlocked.features.remove(&ORDERED);
|
||||
assert!(interlocked.has(INTERLOCK));
|
||||
{
|
||||
let pipe = compile(&interlocked, DevicePolicy::default(), &d).expect("interlocked");
|
||||
let pipe = compile(&interlocked, DevicePolicy::RESIDENT_TABLES, &d).expect("interlocked");
|
||||
assert!(!unordered(&pipe));
|
||||
assert!(pipe.graphics.input_attachments.is_empty());
|
||||
assert!(pipe.graphics.color_attachments.iter().all(Option::is_none));
|
||||
@@ -1902,7 +1904,7 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
}
|
||||
// The blend, which the shader computes: the generic one of `R32Float`, noted.
|
||||
{
|
||||
let pipe = compile(&interlocked, DevicePolicy::default(), &blended).expect("blended");
|
||||
let pipe = compile(&interlocked, DevicePolicy::RESIDENT_TABLES, &blended).expect("blended");
|
||||
let [s] = pipe.graphics.storage_attachments.as_slice() else {
|
||||
panic!("{:?}", pipe.graphics.storage_attachments);
|
||||
};
|
||||
@@ -1917,7 +1919,7 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
// Alpha to coverage, which can drop the fragment's samples, blocks the form.
|
||||
let mut covered = d.clone();
|
||||
covered.alpha_to_coverage = true;
|
||||
match compile(&interlocked, DevicePolicy::default(), &covered) {
|
||||
match compile(&interlocked, DevicePolicy::RESIDENT_TABLES, &covered) {
|
||||
Err(Error::Unsupported(u)) => assert_eq!(
|
||||
(u.feature, u.needs),
|
||||
(Feature::FramebufferFetch, Needs::NotImplemented)
|
||||
@@ -1927,7 +1929,7 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
|
||||
let mut without = interlocked.clone();
|
||||
without.features.remove(&INTERLOCK);
|
||||
let pipe = compile(&without, DevicePolicy::default(), &d).expect("neither");
|
||||
let pipe = compile(&without, DevicePolicy::RESIDENT_TABLES, &d).expect("neither");
|
||||
assert!(unordered(&pipe));
|
||||
assert_eq!(pipe.graphics.input_attachments.len(), 1);
|
||||
assert!(pipe.graphics.storage_attachments.is_empty());
|
||||
@@ -1942,10 +1944,11 @@ fn a_framebuffer_fetch_pipeline_is_ordered_exactly_where_the_device_orders_it()
|
||||
.function("fetch_ordered")
|
||||
.expect("fragment"),
|
||||
)));
|
||||
let pipe = compile(&interlocked, DevicePolicy::default(), &grouped).expect("grouped");
|
||||
let pipe = compile(&interlocked, DevicePolicy::RESIDENT_TABLES, &grouped).expect("grouped");
|
||||
assert!(!unordered(&pipe));
|
||||
assert!(pipe.requirements.features.contains(&INTERLOCK));
|
||||
let pipe = compile(&without, DevicePolicy::default(), &grouped).expect("grouped, neither");
|
||||
let pipe =
|
||||
compile(&without, DevicePolicy::RESIDENT_TABLES, &grouped).expect("grouped, neither");
|
||||
assert!(unordered(&pipe));
|
||||
assert_eq!(pipe.graphics.input_attachments.len(), 1);
|
||||
for f in [ORDERED, INTERLOCK] {
|
||||
@@ -1994,7 +1997,7 @@ fn an_identity_fetch_reads_its_attachments_pushed_texture_in_the_attachments_cla
|
||||
let policy = DevicePolicy {
|
||||
pointer_domain: PointerDomain::Identity,
|
||||
handle_domain: HandleDomain::Identity,
|
||||
..DevicePolicy::default()
|
||||
..DevicePolicy::RESIDENT_TABLES
|
||||
};
|
||||
let dev = Device::from_queries(without, policy).expect("device");
|
||||
let compile =
|
||||
@@ -2200,7 +2203,8 @@ fn a_multisampled_framebuffer_fetch_reads_each_samples_own_color() {
|
||||
d
|
||||
};
|
||||
let compile = |desc: &DeviceDescription, d: &RenderPipelineDescriptor| {
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).expect("device");
|
||||
let dev =
|
||||
Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let pipe = dev.compile_render_pipeline(d, &Budget::standard())?;
|
||||
for s in &pipe.stages {
|
||||
l3(&s.spirv, &pipe.requirements, &dev);
|
||||
@@ -2429,7 +2433,8 @@ fn a_render_pipeline_requires_the_blend_features_its_attachments_need() {
|
||||
d
|
||||
};
|
||||
let compile = |desc: &DeviceDescription, d: &RenderPipelineDescriptor| {
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).expect("device");
|
||||
let dev =
|
||||
Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let pipe = dev.compile_render_pipeline(d, &Budget::standard())?;
|
||||
let enables = desc
|
||||
.required_enables(&pipe.requirements)
|
||||
@@ -2851,7 +2856,8 @@ fn a_render_pipeline_requires_the_portability_features_it_uses() {
|
||||
};
|
||||
// Every pipeline that compiles requires only what its device enabled.
|
||||
let compile = |desc: &DeviceDescription, d: &RenderPipelineDescriptor| {
|
||||
let dev = Device::from_queries(desc.clone(), DevicePolicy::default()).expect("device");
|
||||
let dev =
|
||||
Device::from_queries(desc.clone(), DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
dev.compile_render_pipeline(d, &Budget::standard())
|
||||
.map(|p| {
|
||||
assert_eq!(dev.profile().check(&p.requirements), Ok(()));
|
||||
@@ -2939,8 +2945,8 @@ fn a_render_pipeline_requires_its_framebuffer_sample_counts() {
|
||||
),
|
||||
] {
|
||||
d.raster_sample_count = count;
|
||||
let dev =
|
||||
Device::from_queries(description("lavapipe"), DevicePolicy::default()).expect("device");
|
||||
let dev = Device::from_queries(description("lavapipe"), DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device");
|
||||
let pipe = dev
|
||||
.compile_render_pipeline(&d, &Budget::standard())
|
||||
.expect("lavapipe");
|
||||
@@ -2985,14 +2991,15 @@ fn the_interface_states_the_textures_read_at_the_fragments_own_pixel() {
|
||||
"runtime-floor",
|
||||
]
|
||||
.map(|stem| {
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
(stem, p)
|
||||
})
|
||||
.into();
|
||||
let clamped = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::RobustImageAccess2],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
profiles.push(("runtime-floor without robustImageAccess2", clamped));
|
||||
@@ -3033,7 +3040,7 @@ fn the_interface_states_why_a_slot_takes_no_snapshot() {
|
||||
(d.features).remove(&VkFeature::ShaderDemoteToHelperInvocation),
|
||||
"the 780M's profile demotes"
|
||||
);
|
||||
let ends = Device::from_queries(d, DevicePolicy::default()).expect("device");
|
||||
let ends = Device::from_queries(d, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
for (name, dev, refusals) in [
|
||||
("demote", &demotes, Vec::new()),
|
||||
("no demote", &ends, vec![(0, SnapshotRefusal::Branch)]),
|
||||
@@ -3086,7 +3093,8 @@ fn a_selection_on_the_texel_keeps_the_slot_where_a_helper_may_take_either_arm()
|
||||
return;
|
||||
};
|
||||
for stem in ["amd-780m-radv", "lavapipe"] {
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (bc, entry, refusals) in [
|
||||
(&selecting, "ss_read_selecting", Vec::new()),
|
||||
(
|
||||
@@ -3146,7 +3154,8 @@ fn a_snapshot_variant_reads_its_texture_in_the_copy_alone() {
|
||||
"moltenvk-m3",
|
||||
"runtime-floor",
|
||||
] {
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
let base = crate::pipeline::testing::compile(&bc, "tob_read", &p)
|
||||
.unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
assert_eq!(base.interface.snapshot_textures, [0u32], "{stem}");
|
||||
@@ -3233,8 +3242,8 @@ fn a_snapshot_variant_reads_its_texture_in_the_copy_alone() {
|
||||
/// `the_status_words_are_not_the_functions_writes`).
|
||||
#[test]
|
||||
fn the_interface_states_whether_the_function_writes_memory() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (stem, entry, writes) in [
|
||||
("a3_rog_buffer_rmw", "a3_rog_buffer_rmw", true),
|
||||
("fragment_rog", "rog_loop", true),
|
||||
@@ -3290,8 +3299,8 @@ fn effects_kernel(name: &str, body: &str, extra: &str) -> String {
|
||||
/// through the pointer it is passed, write memory.
|
||||
#[test]
|
||||
fn a_compute_pipeline_states_whether_its_kernel_writes_memory() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
let callee = "define void @put(ptr addrspace(1) noundef %p, i32 noundef %v) #0 {\nentry:\n store i32 %v, ptr addrspace(1) %p, align 4\n ret void\n}\n\nattributes #0 = { noinline }\n\n";
|
||||
for (name, body, extra, writes) in [
|
||||
("bare_return", " ret void\n", "", false),
|
||||
@@ -3344,8 +3353,8 @@ fn a_compute_pipeline_states_whether_its_kernel_writes_memory() {
|
||||
/// command runs) does not. A pipeline's interface states it where one of its stages does.
|
||||
#[test]
|
||||
fn the_interface_states_whether_the_function_takes_a_command_buffer() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
let dirs = [crate::pipeline::testing::fixtures_dir(), engine_dir()];
|
||||
for (dir, stem, entry, reaches) in [
|
||||
(
|
||||
@@ -3392,8 +3401,8 @@ fn the_interface_states_whether_the_function_takes_a_command_buffer() {
|
||||
#[test]
|
||||
fn the_interface_states_what_the_function_may_write_into_command_buffers() {
|
||||
use crate::pipeline::interface::CommandWrites as W;
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (entry, operations, primitive_types, kinds) in [
|
||||
(
|
||||
"icb_replay_encode",
|
||||
@@ -3450,8 +3459,8 @@ fn the_interface_states_what_the_function_may_write_into_command_buffers() {
|
||||
/// stage where the function writes.
|
||||
#[test]
|
||||
fn the_interface_states_whether_the_function_writes_textures() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (stem, entry, writes) in [
|
||||
("fragment_rog", "rog_texture", true),
|
||||
("handles", "argument_buffer_array_write", true),
|
||||
@@ -3498,8 +3507,8 @@ fn the_interface_states_whether_the_function_writes_textures() {
|
||||
/// (`abt_frag_sample`). A standalone kernel's pipeline states its function's.
|
||||
#[test]
|
||||
fn the_interface_states_what_the_function_reaches_beyond_its_bound_slots() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for (stem, entry, reads, writes, storage) in [
|
||||
("handles", "select_read", false, false, false),
|
||||
("handles", "select_null_write", false, false, false),
|
||||
@@ -3599,7 +3608,7 @@ fn a_sample_rate_point_coordinate_is_noted_under_multisampling() {
|
||||
/// A vertex function over a two-triangle strip with a center varying `uv`, and a fragment
|
||||
/// function that loads `root->next` (a `device uint *` member of its `device Node *` buffer)
|
||||
/// and reads through it beside `uv`, writing nothing. Every access through the loaded pointer
|
||||
/// counts a resident miss in the `ExecutionStatus` buffer under the default policy.
|
||||
/// counts a resident miss in the `ExecutionStatus` buffer under the resident-table domains.
|
||||
const WIDE_READ: &str = r#"target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
|
||||
target triple = "air64_v28-apple-macosx26.0.0"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::error::Needs;
|
||||
use crate::pipeline::interface::PatchDomain;
|
||||
|
||||
fn profile(stem: &str) -> DeviceProfile {
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile")
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// Committed profile `stem` with `maxTessellationGenerationLevel` edited to `level`.
|
||||
@@ -24,7 +24,7 @@ fn profile_with_level(stem: &str, level: u32) -> DeviceProfile {
|
||||
);
|
||||
assert_ne!(edited, text, "{stem} states the level");
|
||||
let desc = DeviceDescription::from_khronos_json(&edited, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -30,7 +30,7 @@ use crate::spirv::serialize::serialize;
|
||||
// ---- Fixtures ----
|
||||
|
||||
pub(super) fn profile(stem: &str) -> DeviceProfile {
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::default()).expect("profile")
|
||||
crate::pipeline::testing::profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// The key of user varying `name`.
|
||||
|
||||
@@ -1120,7 +1120,7 @@ fn alpha_to_one_is_refused_only_without_the_feature() {
|
||||
let p = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::AlphaToOne],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
assert!(!p.fields().enabled.features.contains(&VkFeature::AlphaToOne));
|
||||
@@ -1575,7 +1575,7 @@ fn attachment_states_are_identical_or_need_independent_blend() {
|
||||
let floor = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::IndependentBlend],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
let lavapipe = profile("lavapipe");
|
||||
@@ -1809,7 +1809,7 @@ fn a_dual_source_blend_needs_dual_src_blend() {
|
||||
let floor = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::DualSrcBlend],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
assert!(!floor.fields().fragment.dual_src_blend);
|
||||
@@ -1891,7 +1891,7 @@ fn color_outputs_follow_metals_measured_rules() {
|
||||
let floor = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::IndependentBlend],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
for p in [&lavapipe, &profile("moltenvk-m3")] {
|
||||
@@ -2501,7 +2501,7 @@ fn multisampled_fragment_invocations_follow_metals_measured_rules() {
|
||||
let p = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::SampleRateShading],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
assert!(!p.fields().fragment.sample_rate_shading);
|
||||
|
||||
@@ -189,7 +189,7 @@ fn attachment(
|
||||
}
|
||||
|
||||
fn moltenvk() -> DeviceProfile {
|
||||
profile("moltenvk-m3", DevicePolicy::default()).expect("profile")
|
||||
profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// Every pair of Metal's color factors, under alpha factors that read nothing, the source's or
|
||||
@@ -391,7 +391,7 @@ fn a_second_output_needs_dual_source_blending() {
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
assert!(desc.features.remove(&VkFeature::DualSrcBlend));
|
||||
let p = Device::from_queries(desc, DevicePolicy::default())
|
||||
let p = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone();
|
||||
@@ -495,7 +495,7 @@ const LANE: [([BlendFactor; 4], BlendOperation); 11] = {
|
||||
#[test]
|
||||
fn the_lane_s_blends_store_metal_s_rotated() {
|
||||
let mvk = moltenvk();
|
||||
let lvp = profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let lvp = profile("lavapipe", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (i, &([sr, dr, sa, da], op)) in LANE.iter().enumerate() {
|
||||
let a = attachment((sr, dr, op), (sa, da, op));
|
||||
let on_mvk = rotated_blend(&a, &mvk).expect("admitted").expect("blended");
|
||||
@@ -516,7 +516,7 @@ fn inexact_blends_are_announced() {
|
||||
use BlendFactor as F;
|
||||
use BlendOperation as O;
|
||||
let mvk = moltenvk();
|
||||
let lvp = profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let lvp = profile("lavapipe", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
// Metal's color kept and its alpha replaced: in the 440-state sweep, 902 of 65,536 texels
|
||||
// apart on the M4.
|
||||
let kept = attachment((F::Zero, F::One, O::Add), (F::One, F::Zero, O::Add));
|
||||
|
||||
@@ -265,7 +265,7 @@ fn a_text_is_charged_the_same_wherever_it_is_assembled() {
|
||||
let (Some(a), Some(b)) = (assembled(&near), assembled(&far)) else {
|
||||
return;
|
||||
};
|
||||
let p = profile("runtime-floor", DevicePolicy::default()).expect("runtime-floor");
|
||||
let p = profile("runtime-floor", DevicePolicy::RESIDENT_TABLES).expect("runtime-floor");
|
||||
let charged = |bitcode: &[u8]| {
|
||||
let mut m = meter();
|
||||
let artifact = compile_bitcode(
|
||||
|
||||
@@ -273,7 +273,7 @@ fn a_rasterizing_void_vertex_function_is_refused_at_its_link() {
|
||||
.join("../metal2vulkan-validation/profiles/lavapipe.json");
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect("profile");
|
||||
let device = Device::from_queries(description, DevicePolicy::default()).expect("device");
|
||||
let device = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let refused = Err(Error::InvalidDescriptor(
|
||||
DescriptorError::RasterizedVoidVertex,
|
||||
));
|
||||
@@ -656,7 +656,7 @@ fn a_dropped_unwritten_fragment_input_is_absent_from_the_compiled_fragment() {
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect(stem);
|
||||
(
|
||||
stem,
|
||||
Device::from_queries(description, DevicePolicy::default()).expect(stem),
|
||||
Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).expect(stem),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
@@ -725,7 +725,7 @@ fn tessellated_and_mesh_pipelines_answer_an_unwritten_fragment_input_as_a_vertex
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect(stem);
|
||||
let device = Device::from_queries(description, DevicePolicy::default()).expect(stem);
|
||||
let device = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).expect(stem);
|
||||
let budget = Budget::standard();
|
||||
for attached in [true, false] {
|
||||
let named = attached.then(|| (vec!["color".to_string()], None));
|
||||
@@ -795,7 +795,7 @@ fn one_creation_specializes_each_stage_once() {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect(stem);
|
||||
let device = Device::from_queries(description, DevicePolicy::default()).expect(stem);
|
||||
let device = Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).expect(stem);
|
||||
let budget = Budget::standard();
|
||||
let mut descriptor = RenderPipelineDescriptor::new(source(&library, "varying_vertex"));
|
||||
descriptor.fragment = Some(source(&library, "depth_writing_fragment"));
|
||||
|
||||
@@ -1030,7 +1030,7 @@ fn lavapipe() -> crate::device::Device {
|
||||
None,
|
||||
)
|
||||
.expect("description"),
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("device")
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ use crate::device::{DeviceDescription, DevicePolicy};
|
||||
/// The device a command compiles for, as `device.json` holds it and the command line's `--device`
|
||||
/// reads it: a description and a policy, which build the same `Device` (`Device::from_queries`).
|
||||
/// A runtime's compile device is one: metal2vulkan-runtime's is the device's description
|
||||
/// restricted to the features it enables, with the identity pointer and handle domains, which a
|
||||
/// Khronos profile read by `--profile` (the default domains) does not reproduce.
|
||||
/// restricted to the features it enables, under the default policy (the identity pointer and
|
||||
/// handle domains), which a Khronos profile read by `--profile` takes too but whose description
|
||||
/// is the profile's, not restricted to what the runtime enables.
|
||||
#[non_exhaustive]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ReproDevice {
|
||||
|
||||
@@ -226,9 +226,9 @@ pub fn assert_valid(m: TypedModule, profile: &DeviceProfile) -> Vec<u32> {
|
||||
}
|
||||
|
||||
/// Every committed device profile (`validation/profiles/*.json`, read-only), derived through
|
||||
/// `Device::from_queries` with the default policy, sorted by file stem.
|
||||
/// `Device::from_queries` with the resident-table domains, sorted by file stem.
|
||||
pub fn committed_profiles() -> Result<Vec<(String, DeviceProfile)>, String> {
|
||||
committed_profiles_under(DevicePolicy::default())
|
||||
committed_profiles_under(DevicePolicy::RESIDENT_TABLES)
|
||||
}
|
||||
|
||||
/// [`committed_profiles`] that take threadgroup memory: those with
|
||||
|
||||
@@ -229,7 +229,7 @@ fn assemble(depth: u32, escaping: Escaping) -> Option<Vec<u8>> {
|
||||
/// Compile `bc` for `lavapipe` with the default caps: the result, the ledger peak, and the most
|
||||
/// bytes the compile held at once.
|
||||
fn compile(bc: &[u8]) -> (Result<(), Error>, Option<u64>, u64, u64) {
|
||||
let p = profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("lavapipe", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let mut m = Meter::with_caps(&Budget::default(), WORK_UNITS, LEDGER_BYTES);
|
||||
let (compiled, held) = held_during(|| {
|
||||
compile_bitcode(
|
||||
@@ -271,7 +271,7 @@ fn written(bc: &[u8]) -> (u64, u64, u64) {
|
||||
.join("../metal2vulkan-validation/profiles/lavapipe.json");
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let device = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let device = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
let f = Library::from_air(bc)
|
||||
.expect("library")
|
||||
.function("blob")
|
||||
|
||||
@@ -23,7 +23,7 @@ fn device() -> Device {
|
||||
.join("../metal2vulkan-validation/profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// A library of the extern functions `tint` and `shift`, over one module.
|
||||
|
||||
@@ -48,7 +48,7 @@ fn assemble(stem: &str) -> Option<Vec<u8>> {
|
||||
}
|
||||
|
||||
fn prof(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect("committed profile")
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("committed profile")
|
||||
}
|
||||
|
||||
/// The boolean constants `on` true, every other constant undefined (so its gate is off).
|
||||
|
||||
@@ -62,7 +62,7 @@ use crate::spirv::verify::verify;
|
||||
const PROFILES: [&str; 3] = ["moltenvk-m3", "runtime-floor", "lavapipe"];
|
||||
|
||||
fn policy() -> DevicePolicy {
|
||||
DevicePolicy::default()
|
||||
DevicePolicy::RESIDENT_TABLES
|
||||
}
|
||||
|
||||
/// Committed profile `stem`, optionally with buffer robustness disabled (the in-shader encoding)
|
||||
|
||||
@@ -94,7 +94,7 @@ fn an_aggregate_buffer_access_moves_every_member() {
|
||||
let mut want = vec![105.0f32, 206.0, 307.0, 408.0];
|
||||
want.extend(&m);
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let profile = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let profile = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (_, _, module) =
|
||||
compile_kept(&bitcode, "k", &profile).unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let res = Resources {
|
||||
|
||||
@@ -92,7 +92,7 @@ fn kernel(name: &str, buffers: u32, globals: &str, body: &str, decls: &str) -> S
|
||||
}
|
||||
|
||||
fn moltenvk() -> DeviceProfile {
|
||||
profile("moltenvk-m3", DevicePolicy::default()).expect("profile")
|
||||
profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// A wave64-only compute device: the committed RDNA3 description with its subgroup size range
|
||||
@@ -104,7 +104,7 @@ fn wave64() -> DeviceProfile {
|
||||
let narrowed = text.replace("\"minSubgroupSize\": 32", "\"minSubgroupSize\": 64");
|
||||
assert_ne!(narrowed, text, "the description names minSubgroupSize");
|
||||
let desc = DeviceDescription::from_khronos_json(&narrowed, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
@@ -697,8 +697,8 @@ fn matmads_run_cluster32_at_64_lanes() {
|
||||
/// tile's cells are exchanged through workgroup memory.
|
||||
#[test]
|
||||
fn matmads_run_emulated_at_8_and_16_lanes() {
|
||||
let p =
|
||||
crate::pipeline::testing::profile("lavapipe", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("lavapipe", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
for lanes in [SubgroupSize::W8, SubgroupSize::W16] {
|
||||
run_matmads(&p, Tier::Emulated, lanes, &[32, 64, 96]);
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ fn msl_4_1_orders_reach_spirv() {
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as: {why}"),
|
||||
};
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
// Scopes: Device 1, Workgroup 2, Subgroup 3. Semantics: Acquire 0x2, Release 0x4,
|
||||
// AcquireRelease 0x8, UniformMemory 0x40, WorkgroupMemory 0x100, ImageMemory 0x800.
|
||||
let every = 0x40 | 0x100 | 0x800;
|
||||
@@ -585,7 +585,7 @@ fn a_fragment_ordered_tile_atomic_keeps_its_order() {
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as: {why}"),
|
||||
};
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let a = compile(&bc, "f", &p).unwrap_or_else(|e| panic!("f: {e}"));
|
||||
let (_, words) = link_and_validate(&a, &p).unwrap_or_else(|e| panic!("f: {e}"));
|
||||
let text = spirv_dis(&words);
|
||||
@@ -630,7 +630,7 @@ fn a_compare_exchange_failing_acquiring_keeps_its_acquire() {
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as: {why}"),
|
||||
};
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("nvidia-rtx50-linux", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let a = compile(&bc, "k", &p).unwrap_or_else(|e| panic!("k: {e}"));
|
||||
let (_, words) = link_and_validate(&a, &p).unwrap_or_else(|e| panic!("k: {e}"));
|
||||
let text = spirv_dis(&words);
|
||||
@@ -739,7 +739,7 @@ fn thread_atomics_compute_their_documented_words() {
|
||||
let threads = 8;
|
||||
let want: Vec<u32> = (0..threads).flat_map(thread_atomic_words).collect();
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let a = compile(&bc, entry, &p).unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let (_, words) = link_and_validate(&a, &p).unwrap_or_else(|e| panic!("{stem}: {e}"));
|
||||
let text = spirv_dis(&words);
|
||||
|
||||
@@ -50,7 +50,7 @@ fn a_pipeline_covering_by_alpha_notes_the_device_s_coverage() {
|
||||
] {
|
||||
let dev = Device::from_queries(
|
||||
description(stem).expect("committed description"),
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("device");
|
||||
for samples in [1, 4] {
|
||||
|
||||
@@ -76,7 +76,7 @@ fn fixture() -> Option<Vec<u8>> {
|
||||
}
|
||||
|
||||
fn prof(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect("committed profile")
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("committed profile")
|
||||
}
|
||||
|
||||
fn description(stem: &str) -> DeviceDescription {
|
||||
@@ -88,7 +88,7 @@ fn description(stem: &str) -> DeviceDescription {
|
||||
}
|
||||
|
||||
fn device(stem: &str) -> Device {
|
||||
Device::from_queries(description(stem), DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(description(stem), DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// `nvidia-rtx50-linux` with `features` removed from its description (with `Multiview`, the
|
||||
@@ -98,7 +98,7 @@ fn nvidia_without(features: &[F]) -> Device {
|
||||
for f in features {
|
||||
assert!(desc.features.remove(f), "nvidia-rtx50-linux has {f:?}");
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Link `a` alone, relocate it, and run L3; the specialization constants link declared.
|
||||
@@ -848,7 +848,7 @@ fn below_the_floor() -> Device {
|
||||
let mut desc = description("runtime-floor");
|
||||
assert!(desc.features.remove(&F::ShaderOutputLayer));
|
||||
assert!(!desc.features.contains(&F::GeometryShader));
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// What a variant that stores a layered amplification's slice needs on a device without
|
||||
@@ -872,7 +872,7 @@ fn a_profile_without_shader_output_layer_draws_or_refuses_every_amplification()
|
||||
let mut lavapipe = description("lavapipe");
|
||||
assert!(lavapipe.features.remove(&F::ShaderOutputLayer));
|
||||
assert!(lavapipe.features.contains(&F::GeometryShader));
|
||||
let lavapipe = Device::from_queries(lavapipe, DevicePolicy::default()).expect("device");
|
||||
let lavapipe = Device::from_queries(lavapipe, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
for (stem, dev) in [
|
||||
("runtime-floor without shaderOutputLayer", below_the_floor()),
|
||||
("lavapipe without shaderOutputLayer", lavapipe),
|
||||
|
||||
@@ -45,7 +45,7 @@ const PROFILES: [&str; 3] = ["moltenvk-m3", "runtime-floor", "lavapipe"];
|
||||
const DATALAYOUT: &str = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32";
|
||||
|
||||
fn p(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect("profile")
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
fn assemble(name: &str, body: &str) -> Option<Vec<u8>> {
|
||||
|
||||
@@ -216,8 +216,8 @@ fn an_argument_table_call_without_a_function_of_its_type_compiles() {
|
||||
let Some((caller, functions)) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
let none = FunctionConstantValues::defaults();
|
||||
let half = [LinkedSource::new("table_half", &functions, &none)];
|
||||
let empty: &[LinkedSource<'_>] = &[];
|
||||
@@ -235,7 +235,7 @@ pub(super) fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// The pipeline of kernel `entry` with the four functions linked, through the public API.
|
||||
@@ -718,8 +718,8 @@ fn without_listed_tables_every_id_reads_the_null_table() {
|
||||
assert_eq!(entries(&directory), vec![(0, 0, 0); 16]);
|
||||
let none = FunctionConstantValues::defaults();
|
||||
let linked = sources(&functions, &none);
|
||||
let p =
|
||||
crate::pipeline::testing::profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = crate::pipeline::testing::profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("profile");
|
||||
let (_, one) = typed_module_linked(&caller, ONE, &p, &linked).expect("module");
|
||||
for id in [T, 0] {
|
||||
assert_eq!(
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//! an integer where it needs one. `llvm-as` assembles the generated module; without it the test
|
||||
//! skips visibly.
|
||||
//!
|
||||
//! Every profile here takes Metal's `half` rounding and NaN (the default policy), whose answers these
|
||||
//! Every profile here takes Metal's `half` rounding and NaN, whose answers these
|
||||
//! tests check; the maths functions are the device's on every device but MoltenVK
|
||||
//! (`engine_native_maths`).
|
||||
|
||||
@@ -1056,7 +1056,7 @@ fn fp8_widenings_are_the_devices_own_where_it_has_8_bit_floats() {
|
||||
let float8 =
|
||||
crate::device::requirements::SpirvCapability::of(crate::spv::Capability::Float8EXT);
|
||||
for (stem, native) in [("nvidia-rtx50-linux", true), ("lavapipe", false)] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
assert_eq!(p.fields().leaf.float8, native, "{stem}");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
@@ -1134,7 +1134,7 @@ fn arith_kernels_validate_and_compute_on_every_profile() {
|
||||
let (mut met, mut refused) = (Vec::new(), Vec::new());
|
||||
let mut computed = 0;
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let missing = kk.needs.iter().copied().find(|n| !has(&p, *n));
|
||||
@@ -1258,7 +1258,7 @@ fn wide_divisions_share_one_routine_per_form() {
|
||||
crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[crate::device::requirements::VkFeature::ShaderInt64],
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile"),
|
||||
3,
|
||||
@@ -1267,7 +1267,11 @@ fn wide_divisions_share_one_routine_per_form() {
|
||||
),
|
||||
(
|
||||
"amd-rdna3-radv",
|
||||
profile("amd-rdna3-radv", crate::device::DevicePolicy::default()).expect("profile"),
|
||||
profile(
|
||||
"amd-rdna3-radv",
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile"),
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
@@ -1333,7 +1337,7 @@ fn fused_multiply_adds_take_the_profiles_route() {
|
||||
// (profile, OpFmaKHR of the float kernel); its route is the device's `Fma` without them, the
|
||||
// `half` kernel's on every profile.
|
||||
for (stem, khr) in [("moltenvk-m3", 3), ("lavapipe", 0), ("runtime-floor", 0)] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let float = kk.name == "fma_float_rounds_once";
|
||||
let native = !float || khr == 0;
|
||||
@@ -1454,7 +1458,7 @@ fn a_half_fused_multiply_add_is_the_devices_16_bit_fma_on_from_queries() {
|
||||
] {
|
||||
let what = format!("fma_half_rounds_once on {stem} (from_queries)");
|
||||
let desc = description(stem).expect("description");
|
||||
let device = Device::from_queries(desc, crate::device::DevicePolicy::default())
|
||||
let device = Device::from_queries(desc, crate::device::DevicePolicy::RESIDENT_TABLES)
|
||||
.unwrap_or_else(|e| panic!("{what}: {e}"));
|
||||
let p = device.profile();
|
||||
let controls = half_controls(p);
|
||||
@@ -1620,7 +1624,7 @@ fn dot_is_the_devices_op_dot_on_every_profile() {
|
||||
};
|
||||
for stem in ["moltenvk-m3", "amd-rdna3-radv", "lavapipe", "runtime-floor"] {
|
||||
{
|
||||
let policy = DevicePolicy::default();
|
||||
let policy = DevicePolicy::RESIDENT_TABLES;
|
||||
let p = profile(stem, policy).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
@@ -1681,7 +1685,7 @@ fn fast_fmod_is_metals_composition() {
|
||||
("lavapipe", 0, 1),
|
||||
("runtime-floor", 0, 1),
|
||||
] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let kk = &ks[0];
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -1735,7 +1739,7 @@ fn an_ordered_not_equal_is_the_negated_unordered_equal() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let kk = &ks[0];
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -1801,7 +1805,7 @@ fn an_arcp_division_is_the_devices_quotient() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -1887,7 +1891,7 @@ fn a_fast_division_leaves_its_nans_to_the_device() {
|
||||
};
|
||||
nans_are_the_device_s(&bitcode, &ks, false, &[], &|_| true);
|
||||
for stem in every_profile() {
|
||||
let p = profile(&stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(&stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -1984,7 +1988,7 @@ fn a_division_without_arcp_is_the_devices_quotient() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2062,7 +2066,7 @@ fn fast_sincos_is_the_devices_sine_and_cosine() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe", "runtime-floor"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2118,7 +2122,7 @@ fn device_float_environment_notes_follow_the_operations() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (kk, want) in ks.iter().zip(notes) {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2172,7 +2176,7 @@ fn a_float_remainder_is_the_devices_without_every_flag() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2225,7 +2229,7 @@ fn unlowered_arithmetic_refuses_as_not_implemented() {
|
||||
let Some(bitcode) = assemble("refusals", &text) else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &cases {
|
||||
match compile(&bitcode, kk.name, &p) {
|
||||
Err(Error::Unsupported(u)) => {
|
||||
@@ -2332,7 +2336,7 @@ fn float_ops_without_contract_and_reassoc_are_no_contraction() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2429,7 +2433,7 @@ fn arithmetic_the_air_lets_a_compiler_rewrite_notes_fast_math_rewrites() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (i, kk) in ks.iter().enumerate() {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2495,7 +2499,7 @@ fn narrow_float_module_growth_is_bounded() {
|
||||
};
|
||||
let words = ks
|
||||
.each_ref()
|
||||
.map(|kk| words_on(crate::device::DevicePolicy::default(), kk));
|
||||
.map(|kk| words_on(crate::device::DevicePolicy::RESIDENT_TABLES, kk));
|
||||
eprintln!(
|
||||
"half and bfloat growth on {stem}: float {} words, half {} ({:+}), bfloat {} ({:+})",
|
||||
words[0],
|
||||
@@ -2569,7 +2573,7 @@ fn half_rounding_follows_the_operation() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2725,7 +2729,7 @@ fn a_half_rounding_without_float16_is_the_quantize_alone() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (kk, &(_, _, quantizes)) in ks.iter().zip(&cases) {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -2904,7 +2908,7 @@ fn float_ops_without_fast_flags_preserve_signed_zero_inf_nan() {
|
||||
};
|
||||
let (mut declared, mut noted) = (0, 0);
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let supported = p.fields().float_controls.f32.signed_zero_inf_nan_preserve;
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
@@ -2975,7 +2979,7 @@ fn fused_multiply_adds_keep_no_zero_signs() {
|
||||
let Some(bitcode) = assemble("fma-zero-signs", &text) else {
|
||||
return;
|
||||
};
|
||||
for (stem, p) in committed_profiles_with(DevicePolicy::default()).expect("profiles") {
|
||||
for (stem, p) in committed_profiles_with(DevicePolicy::RESIDENT_TABLES).expect("profiles") {
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -3017,7 +3021,7 @@ fn a_convert_tells_a_nan_by_its_bits_where_the_entry_may_assume_none() {
|
||||
};
|
||||
let mut bits = 0;
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -3077,7 +3081,7 @@ fn a_fast_division_is_the_device_s_quotient() {
|
||||
let Some(bitcode) = assemble("fast-quotient", &module(&ks)) else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (kk, fast_math) in ks.iter().zip(fast_math) {
|
||||
{
|
||||
let what = kk.name.to_string();
|
||||
@@ -3190,7 +3194,7 @@ fn nans_are_the_device_s(
|
||||
noted: &dyn Fn(&str) -> bool,
|
||||
) {
|
||||
for stem in ["lavapipe", "moltenvk-m3"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in ks {
|
||||
{
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
@@ -3386,7 +3390,7 @@ fn float_denormals_are_the_devices_and_noted() {
|
||||
return;
|
||||
};
|
||||
for stem in ["moltenvk-m3", "lavapipe"] {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (kk, device) in ks.iter().zip(&devices) {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -3496,7 +3500,7 @@ fn a_nan_test_no_float_mode_folds() {
|
||||
};
|
||||
let (mut bits_tested, mut is_nan_tested) = (0, 0);
|
||||
for stem in PROFILES.into_iter().chain(["lavapipe"]) {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -3547,7 +3551,7 @@ fn a_nan_test_no_float_mode_folds() {
|
||||
Err(AssembleError::Rejected(e)) => panic!("llvm-as rejected {entry}: {e}"),
|
||||
};
|
||||
for stem in PROFILES.into_iter().chain(["lavapipe"]) {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let what = format!("{entry} on {stem}");
|
||||
let a = compile(&bitcode, entry, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
let (_, words) =
|
||||
@@ -3798,7 +3802,7 @@ fn half_moves_are_the_devices_bits() {
|
||||
return;
|
||||
};
|
||||
for stem in ["lavapipe", "moltenvk-m3"] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -3958,7 +3962,7 @@ fn pack_conversions_are_the_devices() {
|
||||
return;
|
||||
};
|
||||
for stem in ["lavapipe", "moltenvk-m3"] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -4057,7 +4061,7 @@ fn float_sign_operations_are_the_devices_on_every_profile() {
|
||||
})
|
||||
};
|
||||
for stem in PROFILES.iter().copied().chain(["lavapipe"]) {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -4236,7 +4240,7 @@ fn float_min_max_are_the_device_s_on_every_profile() {
|
||||
})
|
||||
};
|
||||
for stem in PROFILES.iter().copied().chain(["lavapipe"]) {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -4328,7 +4332,7 @@ fn half_fmod_is_its_float_remainder_on_every_profile() {
|
||||
return;
|
||||
};
|
||||
for stem in PROFILES.iter().copied().chain(["lavapipe"]) {
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
@@ -4423,7 +4427,7 @@ fn mix_is_the_devices_fmix_on_every_profile() {
|
||||
.copied()
|
||||
.chain(["lavapipe", "amd-rdna3-radv"])
|
||||
{
|
||||
let p = profile(stem, crate::device::DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, crate::device::DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for kk in &ks {
|
||||
let what = format!("{} on {stem}", kk.name);
|
||||
let a = compile(&bitcode, kk.name, &p).unwrap_or_else(|e| panic!("{what}: {e:?}"));
|
||||
|
||||
@@ -74,7 +74,7 @@ struct Kernel {
|
||||
|
||||
/// Kernel `entry` of `bc` for profile `stem`, checked through L3: its plan and typed module.
|
||||
fn kernel(bc: &[u8], entry: &str, stem: &str) -> Kernel {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let consts = FunctionConstantValues::defaults();
|
||||
let what = format!("{entry} on {stem}");
|
||||
let a = compile_bitcode(
|
||||
|
||||
@@ -59,7 +59,7 @@ const PROFILES: [&str; 4] = [
|
||||
const DATALAYOUT: &str = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32";
|
||||
|
||||
fn p(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect("profile")
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// Committed profile `stem` without buffer robustness: containment is checked in the shader.
|
||||
@@ -83,7 +83,7 @@ fn without(stem: &str, features: &[VkFeature]) -> DeviceProfile {
|
||||
for f in features {
|
||||
desc.features.remove(f);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -123,7 +123,7 @@ declare {{ <4 x float>, i8 }} @air.sample_texture_2d.v4f32(ptr addrspace(1), ptr
|
||||
}
|
||||
|
||||
fn p(stem: &str) -> DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect(stem)
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect(stem)
|
||||
}
|
||||
|
||||
fn max_bias(p: &DeviceProfile) -> f32 {
|
||||
@@ -426,7 +426,7 @@ fn hoisted_derivatives_take_the_whole_bias() {
|
||||
let without = crate::pipeline::testing::profile_without(
|
||||
"runtime-floor",
|
||||
&[crate::device::requirements::VkFeature::SamplerAnisotropy],
|
||||
crate::device::DevicePolicy::default(),
|
||||
crate::device::DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("profile");
|
||||
for (stem, profile, emulations) in [
|
||||
@@ -502,7 +502,7 @@ fn an_anisotropic_sampler_takes_the_axis_gradients() {
|
||||
.features
|
||||
.remove(&crate::device::requirements::VkFeature::SamplerAnisotropy));
|
||||
}
|
||||
crate::device::Device::from_queries(desc, DevicePolicy::default())
|
||||
crate::device::Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect(stem)
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -70,7 +70,7 @@ fn assemble_module(name: &str, text: &str) -> Option<Vec<u8>> {
|
||||
}
|
||||
|
||||
fn m3() -> DeviceProfile {
|
||||
profile("moltenvk-m3", DevicePolicy::default()).expect("profile")
|
||||
profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile")
|
||||
}
|
||||
|
||||
/// The words of `constexpr sampler(filter::bicubic, ...)` with every axis addressed by `address`
|
||||
@@ -1436,7 +1436,7 @@ fn a_bicubic_sample_is_one_call_of_the_planes_sum() {
|
||||
}
|
||||
Err(AssembleError::Rejected(e)) => panic!("llvm-as rejected bcx_rules: {e}"),
|
||||
};
|
||||
let p = profile("intel-irisxe-rplp-anv", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("intel-irisxe-rplp-anv", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (_, m) = typed_module(&bc, "bcx_rules", &p).expect("typed module");
|
||||
let functions = m.functions();
|
||||
let entry = functions.get(m.entry().func.index()).expect("entry");
|
||||
|
||||
@@ -100,7 +100,7 @@ pub(super) fn device(stem: &str, tweak: impl FnOnce(&mut DeviceDescription)) ->
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
tweak(&mut desc);
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Profile F: `runtime-floor` without device addresses, below the runtime's floor, whose buffers
|
||||
|
||||
@@ -40,7 +40,7 @@ fn profiles() -> [(&'static str, DeviceProfile); 2] {
|
||||
if !int64 {
|
||||
assert!(desc.features.remove(&VkFeature::ShaderInt64));
|
||||
}
|
||||
let p = Device::from_queries(desc, DevicePolicy::default())
|
||||
let p = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone();
|
||||
|
||||
@@ -46,7 +46,7 @@ fn profile_with(stem: &str, robust: bool) -> DeviceProfile {
|
||||
desc.features.remove(&VkFeature::RobustBufferAccess);
|
||||
desc.features.remove(&VkFeature::RobustBufferAccess2);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -284,7 +284,7 @@ fn pointers_chosen_at_run_time_call_the_functions_they_hold() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (kernel, want) in SHAPES {
|
||||
let out = dispatch(&fx, kernel, 1, &p, &[(0, zeros()), (1, zeros())]);
|
||||
let all: Vec<u32> = (0..N).map(want).collect();
|
||||
@@ -307,7 +307,7 @@ fn a_pointer_through_an_integer_is_its_word() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let out = dispatch(&fx, "fpc_int_back", 1, &p, &[(0, zeros()), (1, zeros())]);
|
||||
let all: Vec<u32> = (0..N)
|
||||
.map(|t| if t & 1 != 0 { dbl(t) } else { inc(t) })
|
||||
@@ -331,7 +331,7 @@ fn table_entries_and_addresses_call_and_compare_alike() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let mut table = FunctionTableWords::new(3);
|
||||
let lib = crate::library::Library::from_air(&fx.1).expect("library");
|
||||
let linked = LINKED
|
||||
@@ -372,7 +372,7 @@ fn recursion_through_chosen_pointers_reaches_metal_s_depth() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for k in [1, 2, 4, 8] {
|
||||
let (calls, reach) = (2 * k, 2 * k - 1);
|
||||
let depths: Vec<u8> = (0..N).flat_map(|t| (t / 2).to_le_bytes()).collect();
|
||||
@@ -398,7 +398,7 @@ fn an_unlinked_function_s_address_needs_it() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let needs = |symbol: &str| {
|
||||
Err(Error::NeedsInput(RuntimeInput::LinkedFunction {
|
||||
symbol: DiagName::new(symbol),
|
||||
@@ -422,7 +422,7 @@ fn the_recursion_s_stack_is_refused_where_metal_s_is() {
|
||||
let Some(fx) = fixtures() else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let refused = Err(Error::LimitExceeded(Limit::CallStackBytes));
|
||||
let names = &LINKED[3..];
|
||||
assert_eq!(
|
||||
|
||||
@@ -108,7 +108,7 @@ fn profile(stem: &str, int64: bool) -> DeviceProfile {
|
||||
if !int64 {
|
||||
assert!(desc.features.remove(&VkFeature::ShaderInt64), "{stem}");
|
||||
}
|
||||
let p = Device::from_queries(desc, DevicePolicy::default())
|
||||
let p = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone();
|
||||
|
||||
@@ -59,7 +59,7 @@ fn profiles() -> Vec<(String, DeviceProfile)> {
|
||||
for stem in PROFILES {
|
||||
out.push((
|
||||
stem.to_owned(),
|
||||
profile(stem, DevicePolicy::default()).expect("profile"),
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile"),
|
||||
));
|
||||
out.push((format!("{stem} unrobust"), variant(stem, true, false)));
|
||||
}
|
||||
@@ -80,7 +80,7 @@ fn variant(stem: &str, unrobust: bool, no_int64: bool) -> DeviceProfile {
|
||||
if no_int64 {
|
||||
desc.features.remove(&VkFeature::ShaderInt64);
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default())
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone()
|
||||
|
||||
@@ -112,7 +112,7 @@ fn description(stem: &str) -> DeviceDescription {
|
||||
}
|
||||
|
||||
fn device(stem: &str) -> Device {
|
||||
Device::from_queries(description(stem), DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(description(stem), DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Every committed profile's stem, sorted.
|
||||
|
||||
@@ -366,7 +366,7 @@ fn accesses_through_another_class_are_the_native_words() {
|
||||
.map(|stem| {
|
||||
(
|
||||
stem,
|
||||
profile(stem, DevicePolicy::default()).expect("profile"),
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile"),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
@@ -449,7 +449,7 @@ fn devices() -> Vec<(String, Device)> {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
out.push((
|
||||
stem,
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device"),
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device"),
|
||||
));
|
||||
}
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
@@ -1039,7 +1039,7 @@ fn integer_writes_saturate_to_the_bound_formats_channels() {
|
||||
.map(|stem| {
|
||||
(
|
||||
stem,
|
||||
profile(stem, DevicePolicy::default()).expect("profile"),
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile"),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
@@ -1161,7 +1161,7 @@ fn integer_writes_into_narrow_floats_take_the_devices_conversion() {
|
||||
];
|
||||
let mut checked = 0;
|
||||
for stem in ["lavapipe", "moltenvk-m3"] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (ty, format, narrow) in cases {
|
||||
let what = format!("write {ty:?} over {format:?} on {stem}");
|
||||
let Some(bc) = assemble(&what, &write_kernel(ty)) else {
|
||||
|
||||
@@ -57,7 +57,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("../metal2vulkan-validation/profiles/{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Function `name` of `library` specialized with `dfk_reads` = `live` and `dfk_weight` one where
|
||||
|
||||
@@ -59,7 +59,7 @@ fn device_without(stem: &str, features: &[VkFeature]) -> Device {
|
||||
for f in features {
|
||||
assert!(desc.features.remove(f), "{stem} has {f:?}");
|
||||
}
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// The devices of the raster order tests, each with whether it has the pixel interlock.
|
||||
@@ -175,7 +175,7 @@ fn a_raster_order_group_on_an_input_dead_after_specialization_takes_no_interlock
|
||||
}
|
||||
let floor = Device::from_queries(
|
||||
description("runtime-floor").expect("profile"),
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("device");
|
||||
cases.push((
|
||||
|
||||
@@ -106,7 +106,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display()));
|
||||
let description = DeviceDescription::from_khronos_json(&text, None).expect(stem);
|
||||
Device::from_queries(description, DevicePolicy::default()).expect(stem)
|
||||
Device::from_queries(description, DevicePolicy::RESIDENT_TABLES).expect(stem)
|
||||
}
|
||||
|
||||
/// The `Location` of every user variable of storage class `class` in `words` (built-ins carry no
|
||||
|
||||
@@ -177,7 +177,7 @@ fn the_extension_is_read_from_the_device_description() {
|
||||
("intel-irisxe-anv", false),
|
||||
("runtime-floor", false),
|
||||
] {
|
||||
let p = profile(stem, DevicePolicy::default()).expect(stem);
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect(stem);
|
||||
assert_eq!(unrestricted(&p), listed, "{stem}");
|
||||
}
|
||||
}
|
||||
@@ -192,15 +192,15 @@ fn depth_comparisons_record_the_restricted_range_without_the_extension() {
|
||||
let profiles = [
|
||||
(
|
||||
"radv",
|
||||
profile("amd-rdna3-radv", DevicePolicy::default()).expect("radv"),
|
||||
profile("amd-rdna3-radv", DevicePolicy::RESIDENT_TABLES).expect("radv"),
|
||||
),
|
||||
(
|
||||
"anv",
|
||||
profile("intel-irisxe-anv", DevicePolicy::default()).expect("anv"),
|
||||
profile("intel-irisxe-anv", DevicePolicy::RESIDENT_TABLES).expect("anv"),
|
||||
),
|
||||
(
|
||||
"m3",
|
||||
profile("moltenvk-m3", DevicePolicy::default()).expect("m3"),
|
||||
profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("m3"),
|
||||
),
|
||||
];
|
||||
let [(_, radv), (_, anv), (_, m3)] = &profiles;
|
||||
|
||||
@@ -145,7 +145,7 @@ fn devices_and_unaddressed() -> Vec<(String, Device)> {
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
desc.features.remove(&VkFeature::BufferDeviceAddress);
|
||||
let dev = Device::from_queries(desc, DevicePolicy::default()).expect("device");
|
||||
let dev = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device");
|
||||
assert_ne!(
|
||||
dev.profile().fields().buffer_access,
|
||||
BufferAccess::Addressed
|
||||
@@ -172,7 +172,7 @@ fn devices_with(tweak: impl Fn(&mut DeviceDescription)) -> Vec<(String, Device)>
|
||||
tweak(&mut desc);
|
||||
(
|
||||
stem,
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device"),
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device"),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
@@ -1404,7 +1404,7 @@ fn gate_lavapipe(tweak: impl Fn(&mut Option<GeneratedCommandsProperties>)) -> De
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let mut desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
tweak(&mut desc.generated_commands);
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// The limit `set` changes on a description that states the facts.
|
||||
|
||||
@@ -150,7 +150,7 @@ fn run_word0(plan: &Plan, m: &TypedModule, d: &Dispatch) -> u32 {
|
||||
fn dispatch_kernels_compile_link_and_validate() {
|
||||
let Some(bc) = fixture() else { return };
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, DevicePolicy::default()).expect(stem);
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect(stem);
|
||||
for entry in MARKERS
|
||||
.iter()
|
||||
.chain(&["threadgroup_barrier_store", "device_fence_store"])
|
||||
@@ -256,7 +256,7 @@ fn a_simdgroup_barrier_flattens_or_is_emulated_with_the_tier() {
|
||||
#[test]
|
||||
fn single_region_builtins_run_on_the_interpreter() {
|
||||
let Some(bc) = fixture() else { return };
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let cases: [(&str, Dispatch, u32); 12] = [
|
||||
("thread_index_marker", single([8, 1, 1], [1, 1, 1]), 105),
|
||||
("thread_index_marker", single([4, 1, 1], [2, 1, 1]), 0),
|
||||
@@ -287,7 +287,7 @@ fn single_region_builtins_run_on_the_interpreter() {
|
||||
#[test]
|
||||
fn edge_region_builtins_run_on_the_interpreter() {
|
||||
let Some(bc) = fixture() else { return };
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (t, l) = ([40, 1, 1], [16, 1, 1]);
|
||||
let interior = || Dispatch {
|
||||
local: [16, 1, 1],
|
||||
@@ -320,7 +320,7 @@ fn edge_region_builtins_run_on_the_interpreter() {
|
||||
#[test]
|
||||
fn barrier_kernels_run_on_the_interpreter() {
|
||||
let Some(bc) = fixture() else { return };
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
for (entry, local, want, form) in [
|
||||
(
|
||||
"threadgroup_barrier_store",
|
||||
@@ -358,7 +358,7 @@ fn barrier_kernels_run_on_the_interpreter() {
|
||||
}
|
||||
// The `seq_cst` fence orders through the kernel's binding of the status word where the device
|
||||
// does not address buffers (below the runtime's floor).
|
||||
let floor = device_f(DevicePolicy::default()).expect(PROFILE_F);
|
||||
let floor = device_f(DevicePolicy::RESIDENT_TABLES).expect(PROFILE_F);
|
||||
let (plan, m) =
|
||||
typed_module(&bc, "device_fence_store", floor.profile()).expect("device_fence_store");
|
||||
assert_eq!(
|
||||
@@ -746,7 +746,7 @@ fn a_position_first_used_in_sibling_arms_is_derived_once() {
|
||||
assert!(loads.values().all(|&n| n == 1), "{stem} {what}: {loads:?}");
|
||||
}
|
||||
}
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (plan, m) = typed_module(&arms, "k", &p).expect("compile");
|
||||
let mut spec = BTreeMap::new();
|
||||
for a in [Axis::X, Axis::Y, Axis::Z] {
|
||||
@@ -850,7 +850,7 @@ done:
|
||||
assert!(loads.values().all(|&n| n == 1), "{stem}: {loads:?}");
|
||||
}
|
||||
assert!(read > 0, "no profile reads a push field");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (plan, m) = typed_module(&bc, "k", &p).expect("compile");
|
||||
let mut spec = BTreeMap::new();
|
||||
for a in [Axis::X, Axis::Y, Axis::Z] {
|
||||
|
||||
@@ -429,7 +429,7 @@ fn run_case(plan: &Plan, m: &TypedModule, c: Case, lanes: SubgroupSize) -> Vec<u
|
||||
/// Compile `kernel` on `stem`, validate it, check its barriers against the module's own
|
||||
/// uniformity, and run every case at every width its tier allows.
|
||||
fn check(stem: &str, bc: &[u8], kernel: &str, predicated: bool) {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let a = compile(bc, kernel, &p).unwrap_or_else(|e| panic!("{stem} {kernel}: {e}"));
|
||||
link_and_validate(&a, &p).unwrap_or_else(|e| panic!("{stem} {kernel}: {e}"));
|
||||
let (plan, m) = typed_module(bc, kernel, &p).unwrap_or_else(|e| panic!("{stem} {kernel}: {e}"));
|
||||
@@ -512,7 +512,7 @@ fn uniform_barriers_are_not_predicated() {
|
||||
};
|
||||
for stem in PROFILES {
|
||||
check(stem, &bc, "uniform_barriers_k", false);
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (plan, _) = typed_module(&bc, "uniform_barriers_k", &p).expect("plan");
|
||||
assert!(
|
||||
!plan.facts.contains(&RuntimeFact::PredicationVote),
|
||||
@@ -533,7 +533,7 @@ fn only_a_barrier_in_a_loop_takes_the_vote_word() {
|
||||
] {
|
||||
let Some(bc) = kernel(name, body) else { return };
|
||||
for stem in PROFILES {
|
||||
let p = profile(stem, DevicePolicy::default()).expect("profile");
|
||||
let p = profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let (plan, _) = typed_module(&bc, name, &p).expect("plan");
|
||||
let vote = plan.facts.contains(&RuntimeFact::PredicationVote);
|
||||
let emulated = plan.simd.1 == Tier::Emulated;
|
||||
|
||||
@@ -85,7 +85,7 @@ fn vertex_entries_read_the_builtins_or_the_push_lanes() {
|
||||
profile_without(
|
||||
"runtime-floor",
|
||||
&[VkFeature::ShaderDrawParameters],
|
||||
DevicePolicy::default(),
|
||||
DevicePolicy::RESIDENT_TABLES,
|
||||
)
|
||||
.expect("below the runtime's floor"),
|
||||
));
|
||||
@@ -256,7 +256,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// A draw of patches from base instance 7 writes `[patch_start, 7]` into the evaluation stage's
|
||||
|
||||
@@ -218,7 +218,7 @@ fn device() -> Device {
|
||||
.join("../metal2vulkan-validation/profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
fn stage(lib: &Library, libraries: DynamicLibraries) -> FunctionDescriptor {
|
||||
@@ -234,7 +234,7 @@ fn compile(fd: FunctionDescriptor) -> Result<(), Error> {
|
||||
|
||||
/// `out` after the stage `fd` runs over 16 threads on the CPU interpreter.
|
||||
fn computed(fd: &FunctionDescriptor) -> Vec<u32> {
|
||||
let p = profile("moltenvk-m3", DevicePolicy::default()).expect("profile");
|
||||
let p = profile("moltenvk-m3", DevicePolicy::RESIDENT_TABLES).expect("profile");
|
||||
let m = compile_stage_kept(fd, &p, &mut meter()).unwrap_or_else(|e| panic!("{e}"));
|
||||
const N: u32 = 16;
|
||||
let res = Resources {
|
||||
|
||||
@@ -83,7 +83,7 @@ fn profiles() -> Vec<(String, DeviceProfile)> {
|
||||
for robust in [true, false] {
|
||||
out.push((
|
||||
format!("{stem} robust={robust}"),
|
||||
profile(stem, robust, DevicePolicy::default()),
|
||||
profile(stem, robust, DevicePolicy::RESIDENT_TABLES),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -440,7 +440,7 @@ fn inttoptr_resolves_every_resident_address() {
|
||||
let Some(bc) = assemble_text("from_int", &kernel("from_int", body)) else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", true, DevicePolicy::default());
|
||||
let p = profile("moltenvk-m3", true, DevicePolicy::RESIDENT_TABLES);
|
||||
let a = compile(&bc, "from_int", &p).expect("compile");
|
||||
link_and_validate(&a, &p).expect("L3");
|
||||
let (plan, m) = typed_module(&bc, "from_int", &p).expect("module");
|
||||
@@ -501,7 +501,7 @@ fn inttoptr_resolves_addresses_of_large_sets() {
|
||||
let Some(bc) = assemble_text("from_int", &kernel("from_int", body)) else {
|
||||
return;
|
||||
};
|
||||
let p = profile("moltenvk-m3", true, DevicePolicy::default());
|
||||
let p = profile("moltenvk-m3", true, DevicePolicy::RESIDENT_TABLES);
|
||||
let a = compile(&bc, "from_int", &p).expect("compile");
|
||||
link_and_validate(&a, &p).expect("L3");
|
||||
let (plan, m) = typed_module(&bc, "from_int", &p).expect("module");
|
||||
@@ -679,7 +679,7 @@ fn profile_f_refuses_a_loaded_pointer_dereference() {
|
||||
) else {
|
||||
return;
|
||||
};
|
||||
let f = device_f(DevicePolicy::default()).expect(PROFILE_F);
|
||||
let f = device_f(DevicePolicy::RESIDENT_TABLES).expect(PROFILE_F);
|
||||
match compile(&bc, leaf.name, f.profile()) {
|
||||
Err(Error::Unsupported(u)) => {
|
||||
assert_eq!(u.feature, Feature::DereferenceLoadedPointer);
|
||||
|
||||
@@ -184,7 +184,7 @@ fn profiles() -> Vec<(&'static str, crate::device::profile::DeviceProfile)> {
|
||||
.map(|stem| {
|
||||
(
|
||||
stem,
|
||||
profile(stem, DevicePolicy::default()).expect("profile"),
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("profile"),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
@@ -692,7 +692,10 @@ fn half_float_storage_slots_leave_their_writes_to_the_device() {
|
||||
let mut i = LowerInputs::new();
|
||||
i.storage_images.insert(TARGET, choice);
|
||||
let anv = "intel-irisxe-rplp-anv";
|
||||
let anv = (anv, profile(anv, DevicePolicy::default()).expect("profile"));
|
||||
let anv = (
|
||||
anv,
|
||||
profile(anv, DevicePolicy::RESIDENT_TABLES).expect("profile"),
|
||||
);
|
||||
for (stem, p) in profiles().into_iter().chain([anv]) {
|
||||
// The kernel reads both textures: without formatless reads, the target's choice
|
||||
// declares its format and the source's `RGBA32Float`'s.
|
||||
@@ -769,7 +772,7 @@ fn devices() -> Vec<(String, Device)> {
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
out.push((
|
||||
stem,
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device"),
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device"),
|
||||
));
|
||||
}
|
||||
out.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
@@ -1028,7 +1031,7 @@ fn decoded_half_texels_round_by_the_device_s_conversion() {
|
||||
.join("../metal2vulkan-validation/profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let p = Device::from_queries(desc, DevicePolicy::default())
|
||||
let p = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone();
|
||||
|
||||
@@ -46,7 +46,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// The fixture's library; `None` (skipped) without `llvm-as`.
|
||||
|
||||
@@ -902,7 +902,7 @@ fn heap_half_texels_round_by_the_device_s_conversion() {
|
||||
.join("../metal2vulkan-validation/profiles/moltenvk-m3.json");
|
||||
let text = std::fs::read_to_string(&path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
let p = Device::from_queries(desc, DevicePolicy::default())
|
||||
let p = Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES)
|
||||
.expect("device")
|
||||
.profile()
|
||||
.clone();
|
||||
|
||||
@@ -80,7 +80,7 @@ fn fixture() -> Option<Vec<u8>> {
|
||||
}
|
||||
|
||||
fn venue(stem: &str) -> crate::device::profile::DeviceProfile {
|
||||
profile(stem, DevicePolicy::default()).expect("committed profile")
|
||||
profile(stem, DevicePolicy::RESIDENT_TABLES).expect("committed profile")
|
||||
}
|
||||
|
||||
/// A render pipeline of one color attachment, `pf`, written under `mask` and blended where
|
||||
|
||||
@@ -119,7 +119,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -222,7 +222,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// `compile_with`, `None` where the device lacks a format's storage (refused whatever the blend).
|
||||
|
||||
@@ -146,7 +146,7 @@ fn device(stem: &str) -> Device {
|
||||
.join(format!("{stem}.json"));
|
||||
let text = std::fs::read_to_string(path).expect("profile");
|
||||
let desc = DeviceDescription::from_khronos_json(&text, None).expect("description");
|
||||
Device::from_queries(desc, DevicePolicy::default()).expect("device")
|
||||
Device::from_queries(desc, DevicePolicy::RESIDENT_TABLES).expect("device")
|
||||
}
|
||||
|
||||
/// Whether `e` is a refusal the device's lack of a capability makes, whatever the blend (a
|
||||
|
||||
Loaded 100 of 257 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user