fix up the builder so that this works as a nix expression

This commit is contained in:
2022-07-05 22:58:32 -07:00
parent 5b99d30cda
commit de7da0540d
5 changed files with 111 additions and 40 deletions

View File

@@ -6,3 +6,19 @@ edition = "2021"
[dependencies]
spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", features = ["use-compiled-tools"] }
# these deps are to satisfy internal rustc stuff, since spirv-builder links into rustc internals (HACK).
# these are very likely to break during rustc updates, but they should be noisy.
# just keep filling things in here based on rustc's Cargo.lock until it's satisfied.
# this needs to match the rustc lock file -- not just its Cargo.toml -- so we pin down to the patch level
# /nix/store/rlcla9529bwkd7a7ryrgfz97yyxaaxgd-rust-default-1.62.0-nightly-2022-04-11/lib/rustlib/src/rust/Cargo.lock
cc = "1.0.69, < 1.0.70"
cfg-if = "0.1.10, < 0.1.11"
compiler_builtins = "0.1.70, < 0.1.71"
dlmalloc = "0.2.3, < 0.2.4"
fortanix-sgx-abi = "0.3.3, < 0.3.4"
getopts = "0.2.21, < 0.2.22"
hashbrown = "0.12.0, < 0.12.1"
hermit-abi = "0.2.0, < 0.2.1"
libc = "0.2.121, < 0.2.122"
unicode-width = "0.1.8, < 0.1.9"

View File

@@ -13,7 +13,7 @@ fn main() -> Result<(), Box<dyn Error>> {
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)
.print_metadata(MetadataPrintout::Full)
.capability(Capability::Int8)
// .capability(Capability::PhysicalStorageBufferAddresses)
// .capability(Capability::Addresses)
@@ -24,6 +24,6 @@ fn main() -> Result<(), Box<dyn Error>> {
let initial_result = builder.build()?;
let module_path = initial_result.module.unwrap_single();
println!("get_shader: built: {:?}", module_path);
println!("get_shader: built:\n{}", module_path.display());
Ok(())
}