Skip to content

Commit 4623ccb

Browse files
committed
shader paths in generated manifest.json are relative to the shader crate
1 parent 4ec33b1 commit 4623ccb

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ directories = "5.0.1"
1515
env_home = "0.1.0"
1616
env_logger = "0.10"
1717
log = "0.4"
18+
relative-path = "1.9.3"
1819
serde = { version = "1.0.214", features = ["derive"] }
1920
serde_json = "1.0.132"
2021
toml = "0.8.19"

crates/cargo-gpu/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ clap.workspace = true
1515
directories.workspace = true
1616
env_logger.workspace = true
1717
log.workspace = true
18+
relative-path.workspace = true
1819
serde.workspace = true
1920
serde_json.workspace = true
2021
toml.workspace = true

crates/cargo-gpu/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,12 @@ impl Build {
472472
entry,
473473
path: filepath,
474474
}| {
475+
use relative_path::PathExt;
475476
let path = self.output_dir.join(filepath.file_name().unwrap());
476-
std::fs::copy(filepath, &path).unwrap();
477-
Linkage::new(entry, path)
477+
std::fs::copy(&filepath, &path).unwrap();
478+
let path_relative_to_shader_crate =
479+
path.relative_to(&self.shader_crate).unwrap().to_path("");
480+
Linkage::new(entry, path_relative_to_shader_crate)
478481
},
479482
)
480483
.collect();

0 commit comments

Comments
 (0)