[wgpu-core] introduce Registry .strict_get() & .strict_unregister() and use them for adapters

This works because we never assign errors to adapters (they are never invalid).
This commit is contained in:
teoxoy
2024-09-05 14:30:41 +02:00
committed by Teodor Tanasoaia
parent 70a9c01b48
commit 98426329a4
9 changed files with 81 additions and 105 deletions

View File

@@ -78,7 +78,7 @@ fn main() {
)
.expect("Unable to find an adapter for selected backend");
let info = global.adapter_get_info(adapter).unwrap();
let info = global.adapter_get_info(adapter);
log::info!("Picked '{}'", info.name);
let device_id = wgc::id::Id::zip(1, 0, backend);
let queue_id = wgc::id::Id::zip(1, 0, backend);

View File

@@ -244,8 +244,8 @@ impl Corpus {
};
println!("\tBackend {:?}", backend);
let supported_features = global.adapter_features(adapter).unwrap();
let downlevel_caps = global.adapter_downlevel_capabilities(adapter).unwrap();
let supported_features = global.adapter_features(adapter);
let downlevel_caps = global.adapter_downlevel_capabilities(adapter);
let test = Test::load(dir.join(test_path), adapter.backend());
if !supported_features.contains(test.features) {