Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/spirv-builder-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
/// Shader source and entry point that can be used to create shader linkage.
#[derive(serde::Serialize, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct Linkage {
pub source_path: std::path::PathBuf,
pub source_path: String,
pub entry_point: String,
pub wgsl_entry_point: String,
}

impl Linkage {
pub fn new(entry_point: impl AsRef<str>, source_path: impl AsRef<std::path::Path>) -> Self {
Self {
source_path: source_path.as_ref().to_path_buf(),
// Force a forward slash convention here so it works on all OSs
source_path: source_path
.as_ref()
.components()
.map(|c| c.as_os_str().to_string_lossy())
.collect::<Vec<_>>()
.join("/"),
wgsl_entry_point: entry_point.as_ref().replace("::", ""),
entry_point: entry_point.as_ref().to_string(),
}
Expand Down
Loading