Rebuild shader header when cbindgen sources have changed (#4051)
This was causing the Metal shaders to incorrectly interpret the primitives submitted by GPUI, which in turn caused rendering to be completely borked. Release Notes: - N/A
This commit is contained in:
+17
-7
@@ -70,13 +70,23 @@ fn generate_shader_bindings() -> PathBuf {
|
|||||||
]);
|
]);
|
||||||
config.no_includes = true;
|
config.no_includes = true;
|
||||||
config.enumeration.prefix_with_name = true;
|
config.enumeration.prefix_with_name = true;
|
||||||
cbindgen::Builder::new()
|
|
||||||
.with_src(crate_dir.join("src/scene.rs"))
|
let mut builder = cbindgen::Builder::new();
|
||||||
.with_src(crate_dir.join("src/geometry.rs"))
|
|
||||||
.with_src(crate_dir.join("src/color.rs"))
|
let src_paths = [
|
||||||
.with_src(crate_dir.join("src/window.rs"))
|
crate_dir.join("src/scene.rs"),
|
||||||
.with_src(crate_dir.join("src/platform.rs"))
|
crate_dir.join("src/geometry.rs"),
|
||||||
.with_src(crate_dir.join("src/platform/mac/metal_renderer.rs"))
|
crate_dir.join("src/color.rs"),
|
||||||
|
crate_dir.join("src/window.rs"),
|
||||||
|
crate_dir.join("src/platform.rs"),
|
||||||
|
crate_dir.join("src/platform/mac/metal_renderer.rs"),
|
||||||
|
];
|
||||||
|
for src_path in src_paths {
|
||||||
|
println!("cargo:rerun-if-changed={}", src_path.display());
|
||||||
|
builder = builder.with_src(src_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder
|
||||||
.with_config(config)
|
.with_config(config)
|
||||||
.generate()
|
.generate()
|
||||||
.expect("Unable to generate bindings")
|
.expect("Unable to generate bindings")
|
||||||
|
|||||||
Reference in New Issue
Block a user