Skip to content

Commit 9ff91d7

Browse files
committed
well.. everything is in the TARGET_SPECS const from its compilation so, let us just use that.
1 parent 0ad5521 commit 9ff91d7

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

crates/cargo-gpu/src/show.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,9 @@ impl Show {
8686
}
8787

8888
fn available_spirv_targets_iter() -> impl Iterator<Item = String> {
89-
const TARGET_SPECS_PATH: &str = "~/.cache/rust-gpu/codegen/<version_string>/target-specs/";
90-
91-
let cache_iter = std::fs::read_dir(TARGET_SPECS_PATH)
92-
.ok()
93-
.into_iter()
94-
.flatten()
95-
.filter_map(|entry| entry.ok())
96-
.map(|de| de.path())
97-
.filter(|p| p.extension().is_some_and(|v| v == "json"))
98-
.filter_map(|mut p| {
99-
p.set_extension("");
100-
p.file_name().map(|f| f.to_string_lossy().into_owned())
101-
});
102-
103-
let legacy_iter = legacy_target_specs::TARGET_SPECS
89+
legacy_target_specs::TARGET_SPECS
10490
.iter()
105-
.map(|(spec, _src)| spec.replace(".json", ""));
106-
107-
cache_iter.chain(legacy_iter)
91+
.filter(|(spec, _src)| spec.contains("vulkan"))
92+
.map(|(spec, _src)| spec.replace(".json", ""))
10893
}
10994
}

0 commit comments

Comments
 (0)