restructure this multi-crate project to use Cargo's "workspace" feature
this solves an issue in the Nix build, where managing multiple Cargo.lock files is otherwise tricky. it causes (or fails to fix?) an adjacent issue where the spirv builder doesn't seem to have everything it needs vendored.
This commit is contained in:
29
crates/spirv_backend_builder/src/main.rs
Normal file
29
crates/spirv_backend_builder/src/main.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use spirv_builder::{Capability, MetadataPrintout, SpirvBuilder};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
// based on EmbarkStudios/rust-gpu/examples/runners/wgpu/src/lib.rs:maybe_watch
|
||||
let manifest_dir = env!("CARGO_MANIFEST_DIR");
|
||||
let crate_path = [manifest_dir, "../", "spirv_backend"]
|
||||
.iter()
|
||||
.copied()
|
||||
.collect::<PathBuf>();
|
||||
println!("get_shader: constructing builder");
|
||||
let builder = SpirvBuilder::new(crate_path, "spirv-unknown-vulkan1.1")
|
||||
//let builder = SpirvBuilder::new(crate_path, "spirv-unknown-spv1.3")
|
||||
.print_metadata(MetadataPrintout::None)
|
||||
.capability(Capability::Int8)
|
||||
// .capability(Capability::PhysicalStorageBufferAddresses)
|
||||
// .capability(Capability::Addresses)
|
||||
// .capability(Capability::GenericPointer)
|
||||
;
|
||||
|
||||
println!("get_shader: building");
|
||||
let initial_result = builder.build()?;
|
||||
|
||||
let module_path = initial_result.module.unwrap_single();
|
||||
println!("get_shader: built: {:?}", module_path);
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user